diff --git a/.github/workflows/transloaditkit-ci.yml b/.github/workflows/transloaditkit-ci.yml index 9ed6f60..fe5269c 100644 --- a/.github/workflows/transloaditkit-ci.yml +++ b/.github/workflows/transloaditkit-ci.yml @@ -9,14 +9,18 @@ jobs: run: echo "BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV - name: Get swift version run: swift --version - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Build run: swift build - name: Run tests run: swift test - - uses: 8398a7/action-slack@v3 + - name: Send Slack notification if: failure() && env.BRANCH == 'main' - with: - status: failure env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_TEXT: >- + ${{ github.workflow }} failed for ${{ github.repository }} on ${{ github.ref_name }}: + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + node -e "process.stdout.write(JSON.stringify({ text: process.env.SLACK_TEXT }))" | + curl --fail-with-body -X POST -H 'Content-type: application/json' --data-binary @- "$SLACK_WEBHOOK_URL"