diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc1b60035..81c77e2d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,3 +87,73 @@ jobs: files: dist/* fail_on_unmatched_files: true generate_release_notes: true + - name: Publish message to slack + uses: slackapi/slack-github-action@v2.0.0 + if: success() && startsWith(github.ref, 'refs/tags/') + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + { + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": "✅ New codegen-sdk Release Successfully Published! 🚀", + "emoji": true + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Version:* ${{ github.ref_name }}\n*Released by:* <${{ github.server_url }}/${{ github.actor }}|@${{ github.actor }}>\n\n*Links:*\n• <${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|GitHub Release>\n• " + } + }, + { + "type": "context", + "elements": [ + { + "type": "mrkdwn", + "text": "" + } + ] + } + ] + } + - name: Publish failed message to slack + uses: slackapi/slack-github-action@v2.0.0 + if: failure() && startsWith(github.ref, 'refs/tags/') + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + { + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": "❌ codegen-sdk Release Failed", + "emoji": true + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Version:* ${{ github.ref_name }}\n*Attempted by:* <${{ github.server_url }}/${{ github.actor }}|@${{ github.actor }}>\n\n*Details:*\n• Failed to publish version ${{ github.ref_name }}\n• <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run>" + } + }, + { + "type": "context", + "elements": [ + { + "type": "mrkdwn", + "text": "Failed at " + } + ] + } + ] + } diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 5d3716f31..1a7a6ddb1 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -94,7 +94,7 @@ jobs: # changing the following value will significantly affect github's cost. Be careful and consult with the team before changing it. runs-on: ubuntu-latest-32 if: contains(github.event.pull_request.labels.*.name, 'parse-tests') || github.event_name == 'push' || github.event_name == 'workflow_dispatch' - + environment: parse-tests steps: - uses: actions/checkout@v4 - name: Setup backend @@ -121,6 +121,41 @@ jobs: with: flag: no-flag codecov_token: ${{ secrets.CODECOV_TOKEN }} + - name: Notify parse tests failure + uses: slackapi/slack-github-action@v2.0.0 + if: failure() && github.event_name == 'push' && false + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + { + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": "❌ Parse Tests Failed", + "emoji": true + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Branch:* ${{ github.ref_name }}\n*Triggered by:* <${{ github.server_url }}/${{ github.actor }}|@${{ github.actor }}>\n\n*Details:*\n• <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run>" + } + }, + { + "type": "context", + "elements": [ + { + "type": "mrkdwn", + "text": "Failed at " + } + ] + } + ] + } # test_codemod_diffs: # # changing the following value will significantly affect github's cost. Be careful and consult with the team before changing it. # runs-on: ubuntu-latest-16