Fields
steps: - uses: h3y6e/action-slack@v4 with: status: ${{ job.status }} fields: job,took env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required MATRIX_CONTEXT: ${{ toJson(matrix) }} # requiredIf you have more than one, please enter it in csv format. Corresponding types are as follows.

| Field | Environment Variable | Description |
|---|---|---|
| repo | AS_REPO | A working repository name |
| commit | AS_COMMIT | commit hash |
| eventName | AS_EVENT_NAME | trigger event name |
| ref | AS_REF | git reference |
| workflow | AS_WORKFLOW | Generate a workflow link from git sha |
| workflowRun | AS_WORKFLOW_RUN | Generate a link to the present workflow run |
| message | AS_MESSAGE | commit message |
| author | AS_AUTHOR | The author who pushed |
| action | AS_ACTION | Generate a checks page link from git sha |
| job | AS_JOB | Generate a job run link of the job that was executed |
| took | AS_TOOK | Execution time for the job |
| pullRequest | AS_PULL_REQUEST | Pull Request title, number with link |
steps: - uses: h3y6e/action-slack@v4 with: status: ${{ job.status }} fields: repo,commit env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # requiredIf you want all items, specify all.
steps: - uses: h3y6e/action-slack@v4 with: status: ${{ job.status }} fields: all env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # requiredMatrix with job_name
Section titled “Matrix with job_name”In either of the following cases, you must use the job_name parameter instead of the MATRIX_CONTEXT.
- Overwrite job name by
namesyntax - Using
matrixwithinclude
Because when constructing the job name in the action-slack, the key specified by include is included in the matrix map.
It does not match the actual job name.
jobs: test: runs-on: ${{ matrix.os }} strategy: matrix: os: [macos-latest, windows-latest, ubuntu-latest] node: [18, 20, 22, 24] include: - os: windows-latest node: 8 npm: 6
steps: - uses: h3y6e/action-slack@v4 with: status: ${{ job.status }} job_name: test (${{ matrix.os }}, ${{ matrix.node }}) # named without `npm` fields: job,took env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required