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

Fix slack notifications with external PRs #11346

Closed
sjohnr opened this issue Jun 7, 2022 · 2 comments
Closed

Fix slack notifications with external PRs #11346

sjohnr opened this issue Jun 7, 2022 · 2 comments
Assignees
Labels
in: build An issue in the build type: task A general task

Comments

@sjohnr
Copy link
Member

sjohnr commented Jun 7, 2022

See Gamesight/slack-workflow-status#38

@sjohnr sjohnr added in: build An issue in the build type: task A general task labels Jun 7, 2022
@sjohnr sjohnr self-assigned this Jun 7, 2022
@sjohnr sjohnr closed this as completed in d1cb236 Jun 7, 2022
@sjohnr sjohnr reopened this Jun 15, 2022
@sjohnr
Copy link
Member Author

sjohnr commented Jun 15, 2022

This fix was unsuccessful. Reopening to investigate further.

@sjohnr
Copy link
Member Author

sjohnr commented Jun 15, 2022

Upon investigation, the existing fix put in place should have resolved the issue.

Notes:

The current step looks like this:

      - name: Send Slack message
        # Workaround while waiting for Gamesight/slack-workflow-status#38 to be fixed
        # See https://github.com/Gamesight/slack-workflow-status/issues/38
        uses: sjohnr/slack-workflow-status@9eb3eb361c03f8bb9271782f987f472adfc31056
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
          channel: '#spring-security-ci'
          name: 'CI Notifier'

This step points to this commit in a fork of the slack-workflow-status action, but GitHub doesn't seem to be using this commit.

The fix filters out PRs from external forks of the project by comparing the repository url of the pull request to the repository url of the workflow run.

See an example of the workflow run API response the action is working from. The action also queries the jobs for the workflow run.

sjohnr added a commit that referenced this issue Jul 5, 2022
@sjohnr sjohnr closed this as completed Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: build An issue in the build type: task A general task
Projects
None yet
Development

No branches or pull requests

1 participant