-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Slack Notification GitHub Action Failing Due to Missing Webhook URL #1084
Comments
Can we maybe only run the Slack step if the SLACK_WEBHOOK_URL is defined? |
yes that was my original thought and i tried updating the test.yml file to handle the case where the Slack webhook secret is not defined like this slack:
needs:
- test
if: always() # also execute when test fails
runs-on: ubuntu-latest
steps:
- name: Determine if we need to notify
uses: Jimdo/should-i-notify-action@main
id: should_notify
with:
needs_context: ${{ toJson(needs) }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check if secret exists
id: check_secret
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_ROBOTICS_CI_WEBHOOK }}
run: |
if [[ -z "$SLACK_WEBHOOK" ]]; then
echo "slack_webhook_exists=false" >> $GITHUB_ENV
else
echo "slack_webhook_exists=true" >> $GITHUB_ENV
fi
- name: Slack workflow notification
if: steps.should_notify.outputs.should_send_message == 'yes' && env.slack_webhook_exists == 'true'
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_ROBOTICS_CI_WEBHOOK }}
channel: "robotik-ci"
name: "NiceGUI" |
@rodja The code changes from @michangelis' comment #1084 (comment) are part of his PR #1087. |
@michangelis can you create a separate pull request for the slack fix? That way your contribution will be tracked in the repo and we can discuss the carousel from #1087 distinced from this. |
sure thing |
…external contributors
Fix Issue #1084 undefined slack url for passing checks for external c…
Wonderful. I just merged your code. Thanks for contributing! |
Discussed in #1068
Originally posted by michangelis June 24, 2023
Question
Hello,
I encountered an issue while contributing to the repository. It seems the GitHub action Gamesight/slack-workflow-status@master is failing due to a missing Slack webhook URL.
Here is the error message I received:
As an external contributor, I do not have the necessary permissions to add the SLACK_WEBHOOK_URL secret to the repository's settings. The secret appears to be necessary for the GitHub action to send notifications to Slack.
Could you please look into this issue? I believe that adding the SLACK_WEBHOOK_URL secret to the repository's settings should resolve it.
Please let me know if there's anything else I can provide to assist in resolving this.
The text was updated successfully, but these errors were encountered: