slack-action icon indicating copy to clipboard operation
slack-action copied to clipboard

Shell problem in entrypoint file (?)

Open chapati23 opened this issue 5 years ago • 6 comments

Followed the README, and it doesn't work for me, here's the problem:

image

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?

chapati23 avatar Aug 29 '19 15:08 chapati23

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

chapati23 avatar Aug 29 '19 16:08 chapati23

Getting this and using a public ID

EDIT: Didn't read the error properly, apologies. It was a scope issue with the OATH

fullstackfool avatar Dec 11 '19 13:12 fullstackfool

Have problems with the Oauth scopes. But this false-positive error message should be fixed to avoid confusion.

StianOvrevage avatar Jan 24 '20 18:01 StianOvrevage

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\",
          }'

saintfirewater avatar Feb 07 '20 02:02 saintfirewater

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.

StianOvrevage avatar Feb 10 '20 11:02 StianOvrevage

I ran into this issue as well and created a PR https://github.com/pullreminders/slack-action/pull/16

robpc avatar Feb 28 '20 20:02 robpc