Skip to content

Commit

Permalink
[#171] Update Technique 2 to use GitHub Action Contexts instead of va…
Browse files Browse the repository at this point in the history
…lues property (#172)
  • Loading branch information
mwbrooks committed Jan 25, 2023
1 parent 82b575c commit e4e5777
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ By creating a new Slack app or using an existing one, this approach allows your
## Setup

* [Create a Slack App][apps] for your workspace (alternatively use an existing app you have already created and installed).
* Add the [`chat.write`](https://api.slack.com/scopes/chat:write) bot scope under **OAuth & Permissions**.
* Add the [`chat:write`](https://api.slack.com/scopes/chat:write) bot scope under **OAuth & Permissions**.
* Install the app to your workspace.
* Copy the app's Bot Token from the **OAuth & Permissions** page and [add it as a secret in your repo settings][repo-secret] named `SLACK_BOT_TOKEN`.
* Invite the bot user into the channel you wish to post messages to (`/invite @bot_user_name`).
Expand Down
7 changes: 2 additions & 5 deletions example-workflows/Technique_2_Slack_App/JSON_payload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
"type": "button",
"text": {
"type": "plain_text",
"text": $values.button_text
"text": "${{ github.sha }}"
},
"url": $values.button_url
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
Expand All @@ -42,6 +42,3 @@ jobs:
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
values: |
button_text: ${{ github.sha }}
button_url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

0 comments on commit e4e5777

Please sign in to comment.