Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 35 additions & 10 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v5
with:
version: ${{ env.PNPM_VERSION }}

- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
Expand Down Expand Up @@ -50,11 +50,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
uses: 8398a7/action-slack@v3
uses: slackapi/slack-github-action@v3
with:
status: failure
fields: workflow, repo, message, commit, author, eventName, ref, job
job_name: test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "❌ Tests failed"
attachments:
- color: "danger"
fields:
- title: "Workflow"
value: "${{ github.workflow }}"
short: true
- title: "Repo"
value: "<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>"
short: true
- title: "Message"
value: "${{ github.event.head_commit.message }}"
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.event.head_commit.message is only populated for certain events (notably push). If this workflow is later extended to workflow_dispatch/pull_request, this field will be empty and the Slack message will lose the commit context. Consider using a fallback (e.g. PR title for PR events, or github.sha) so the notification always has a useful message.

Suggested change
value: "${{ github.event.head_commit.message }}"
value: "${{ github.event.head_commit.message || github.event.pull_request.title || github.sha }}"

Copilot uses AI. Check for mistakes.
short: false
- title: "Commit"
value: "<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
short: true
- title: "Author"
value: "${{ github.actor }}"
short: true
- title: "Event"
value: "${{ github.event_name }}"
short: true
- title: "Ref"
value: "${{ github.ref }}"
short: true
- title: "Job"
value: "test"
short: true