Update Slack message to use PR title
Closed this issue · 3 comments
lakshmiun commented
Update Slack message to use PR title
priya-swaminathan commented
I would like this too!
scflode commented
You can use a env variable like this:
env:
PR_TITLE: ${{ github.event.pull_request.title || 'main' }}
PR_URL: https://github.com/[ORG]/[REPO]/pull/${{ github.event.number }}
Then use it in the title (or wherever):
- name: Notify
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.YOUR_SECRET }}
SLACK_USERNAME: Build Bot
SLACK_ICON_EMOJI: ":building_construction:"
SLACK_TITLE: CI started 🎬
SLACK_MESSAGE: CI build for `${{ env.PR_TITLE }}` (${{ env.PR_URL }}) has started
SLACK_FOOTER: CI runner
SLACK_CHANNEL: [CHANNEL]
MSG_MINIMAL: true