8398a7 / action-slack

Provides the function of slack notification to GitHub Actions.

Home Page:https://action-slack.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to pass parameters in the text field?

bennymeade opened this issue · comments

Set a job env var: QA_ENV_URL: myprivateurl

- name: Slack notification with repo links
        if: always()
        uses: 8398a7/action-slack@v3.13.0
        with:
          status: ${{ job.status }}
          fields: message,author,eventName,workflow
          icon_emoji: ':speaker:'
          text: 'Company repo: ${GITHUB_REF##*/} :construction_worker:'
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TEST_AUTOMATION_QA }}

This example prints the full line as a string.
image

Is it possible to pass parameters in the text field?

I got it working using this syntax:

text: '${{ github.head_ref || github.ref_name }} branch info :construction_worker:'

image