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

Hey 👋🏻, I'm trying for a quite some time now to send a file using this Slack Action. #178

Open
Pedro-Ivo-Neves opened this issue Apr 16, 2024 · 2 comments

Comments

@Pedro-Ivo-Neves
Copy link

Hey 👋🏻, I'm trying for a quite some time now to send a file using this Slack Action.

Here's the code.

name: 'Slack Notification Test'

on:
  push:
    branches:
      - main

jobs:
    slack_notification:
        runs-on: ubuntu-latest
        steps:

            - name: Checkout ⚙️
              uses: actions/checkout@v3


            - name: Slack Notification
              uses: rtCamp/[email protected]
              env:
                SLACK_CHANNEL: testes-de-automations
                SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
                SLACK_ICON: https://github.com/rtCamp.png?size=48
                SLACK_MESSAGE: ${{ GITHUB.event.commits.message }}
                SLACK_TITLE: 'Commit from: ${{ github.repository }}'
                SLACK_USERNAME: ${{ github.actor}}
                SLACK_FILE_UPLOAD: .github/workflows/test.txt
                SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
                # SLACK_WEBHOOK: ${{ secrets.SLACK_KEY_URL }}

And it gives me the following answer

image

But it doesn't send the file neither the message.

Can someone help?

Originally posted by @Pedro-Ivo-Neves in #177

@csilva-intakedesk
Copy link

This is a required parameter

 # SLACK_WEBHOOK: ${{ secrets.SLACK_KEY_URL }}

And it will priory it to Token. You can see the logic at: https://github.com/rtCamp/action-slack-notify/blob/master/entrypoint.sh#L25

@jutikorn
Copy link

I am also facing a similar issue on @v2.2.0 while @v2 has no problem. They both print different messages:

  • On @v2.2.0:
[ERROR] Secret `SLACK_WEBHOOK` is missing. Please add it to this action for proper execution.

Job failed

  • On @2:
[ERROR] Secret `SLACK_WEBHOOK` is missing. Falling back to using `SLACK_TOKEN` and `SLACK_CHANNEL`.

Job success

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

3 participants