diff --git a/.github/workflows/management-account-apply.yml b/.github/workflows/management-account-apply.yml index d08602ab..c0b15b2a 100644 --- a/.github/workflows/management-account-apply.yml +++ b/.github/workflows/management-account-apply.yml @@ -37,6 +37,9 @@ jobs: - run: terraform apply -auto-approve if: github.event.ref == 'refs/heads/main' + - name: Save Commit Header + run: | + echo "COMMIT_MESSAGE_HEADER=$(git log -1 --pretty=%B | head -n 1)" >> $GITHUB_ENV - name: Slack failure notification if: ${{ failure() && github.ref == 'refs/heads/main' }} uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 @@ -48,7 +51,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": ":x: *GitHub Workflow Failed!* \n\nA workflow has failed in the repository **.\n\n*Workflow:* `${{ github.workflow }}`\n*Branch:* `${{ github.ref_name }}`\n*Commit:* `${{ github.sha }}` - _`${{ format(github.event.head_commit.message, 'replace', '\\n', ' ') }}`_\n*Author:* `${{ github.event.head_commit.author.name }}`"}}, + "text": ":x: *GitHub Workflow Failed!* \n\nA workflow has failed in the repository **.\n\n*Workflow:* `${{ github.workflow }}`\n*Branch:* `${{ github.ref_name }}`\n*Commit:* `${{ github.sha }}` - _`${{ env.COMMIT_MESSAGE_HEADER }}`_\n*Author:* `${{ github.event.head_commit.author.name }}`"}}, { "type": "actions", "elements":[ diff --git a/.github/workflows/organisation-security-apply.yml b/.github/workflows/organisation-security-apply.yml index 600085aa..653713e7 100644 --- a/.github/workflows/organisation-security-apply.yml +++ b/.github/workflows/organisation-security-apply.yml @@ -37,6 +37,9 @@ jobs: - run: terraform apply -auto-approve if: github.event.ref == 'refs/heads/main' + - name: Save Commit Header + run: | + echo "COMMIT_MESSAGE_HEADER=$(git log -1 --pretty=%B | head -n 1)" >> $GITHUB_ENV - name: Slack failure notification if: ${{ failure() && github.ref == 'refs/heads/main' }} uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 @@ -48,7 +51,7 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": ":x: *GitHub Workflow Failed!* \n\nA workflow has failed in the repository **.\n\n*Workflow:* `${{ github.workflow }}`\n*Branch:* `${{ github.ref_name }}`\n*Commit:* `${{ github.sha }}` - _`${{ format(github.event.head_commit.message, 'replace', '\\n', ' ') }}`_\n*Author:* `${{ github.event.head_commit.author.name }}`"}}, + "text": ":x: *GitHub Workflow Failed!* \n\nA workflow has failed in the repository **.\n\n*Workflow:* `${{ github.workflow }}`\n*Branch:* `${{ github.ref_name }}`\n*Commit:* `${{ github.sha }}` - _`${{ env.COMMIT_MESSAGE_HEADER }}`_\n*Author:* `${{ github.event.head_commit.author.name }}`"}}, { "type": "actions", "elements":[ diff --git a/.github/workflows/test-alert-workflow.yml b/.github/workflows/test-alert-workflow.yml index 4dd48348..30428460 100644 --- a/.github/workflows/test-alert-workflow.yml +++ b/.github/workflows/test-alert-workflow.yml @@ -1,6 +1,9 @@ name: Test Alert Workflow on: + push: + branches: + - main pull_request: branches: - main @@ -13,6 +16,10 @@ jobs: contents: read steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Save Commit Header + run: | + echo "COMMIT_MESSAGE_HEADER=$(git log -1 --pretty=%B | head -n 1)" >> $GITHUB_ENV - name: Slack failure notification uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0 with: