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

Slack Notification GitHub Action Failing Due to Missing Webhook URL #1084

Closed
falkoschindler opened this issue Jun 26, 2023 Discussed in #1068 · 7 comments
Closed

Slack Notification GitHub Action Failing Due to Missing Webhook URL #1084

falkoschindler opened this issue Jun 26, 2023 Discussed in #1068 · 7 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@falkoschindler
Copy link
Contributor

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:

Error: Error: Input required and not supplied: slack_webhook_url
Error: Input required and not supplied: slack_webhook_url

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.

@rodja
Copy link
Member

rodja commented Jun 26, 2023

Can we maybe only run the Slack step if the SLACK_WEBHOOK_URL is defined?

@michangelis
Copy link
Contributor

michangelis commented Jun 26, 2023

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"

@falkoschindler
Copy link
Contributor Author

@rodja The code changes from @michangelis' comment #1084 (comment) are part of his PR #1087.

This was referenced Jun 26, 2023
@rodja
Copy link
Member

rodja commented Jun 27, 2023

@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.

@michangelis
Copy link
Contributor

sure thing

michangelis added a commit to michangelis/nicegui that referenced this issue Jun 28, 2023
@michangelis
Copy link
Contributor

@rodja i opened a new PL as you recommended addressing the specific issue so it can be tracked in the repo. Here is the link #1105

rodja added a commit that referenced this issue Jun 29, 2023
Fix Issue #1084 undefined slack url for passing checks for external c…
@rodja
Copy link
Member

rodja commented Jun 29, 2023

Wonderful. I just merged your code. Thanks for contributing!

@rodja rodja closed this as completed Jun 29, 2023
@rodja rodja added this to the 1.2.24 milestone Jun 29, 2023
@rodja rodja added the enhancement New feature or request label Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants