slack-action
slack-action copied to clipboard
Shell problem in entrypoint file (?)
Followed the README, and it doesn't work for me, here's the problem:

Link to failing job: https://github.com/chapati23/hello-github-actions/pull/4/checks#step:3:7
My job code is as follows:
jobs:
slack-notifier:
runs-on: ubuntu-latest
steps:
- name: Notify slack
env:
SLACK_BOT_TOKEN: ${{secrets.SLACK_BOT_TOKEN}}
uses: pullreminders/slack-action@master
with:
args: '{\"channel\":\"D790ZUYJH\",\"text\":\"Hello world\"}'
Not 100% sure but this looks like some shell/bash syntax issue.
Any idea what's going wrong here?
Ok, partly my stupidity for not noticing that it is indeed working, i just tried to use a DM ID which doesn't seem to work. public channel ID did the trick.
however, still doesn't explain the weird shell warning
Getting this and using a public ID
EDIT: Didn't read the error properly, apologies. It was a scope issue with the OATH
Have problems with the Oauth scopes. But this false-positive error message should be fixed to avoid confusion.
I get the exactly same problem, and I don't use channel ID because the channel is private. How could I solve it?
This is my yml code.
jobs:
# start deployment
notify_start:
name: notify deployment start
runs-on: ubuntu-latest
steps:
- name: start
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: pullreminders/slack-action@master
with:
args: '{
\"text\": \"start deployment\",
}'
I just reverted to using plain curl which is almost as simple but avoids the new abstraction/indirection of this slack-action:
- name: Notify slack
if: github.ref == 'refs/heads/develop'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
run: |
curl -X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
-d '{"channel":"XXXXXXX","text":"Re-deployed development environment"}' \
https://slack.com/api/chat.postMessage
Remember to replace the Channel ID. You find it in the URL when using Slack in the browser.
I ran into this issue as well and created a PR https://github.com/pullreminders/slack-action/pull/16