Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell problem in entrypoint file (?) #7

Open
chapati23 opened this issue Aug 29, 2019 · 6 comments
Open

Shell problem in entrypoint file (?) #7

chapati23 opened this issue Aug 29, 2019 · 6 comments

Comments

@chapati23
Copy link

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
Copy link
Author

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

@fullstackfool
Copy link

fullstackfool commented Dec 11, 2019

Getting this and using a public ID

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

@StianOvrevage
Copy link

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

@saintfirewater
Copy link

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

@StianOvrevage
Copy link

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.

@robpc
Copy link
Contributor

robpc commented Feb 28, 2020

I ran into this issue as well and created a PR #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants