-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add first attempt at alert.yml workflow
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Alert | ||
on: | ||
schedule: | ||
- cron: '30 10 * * 1' | ||
workflow_dispatch: | ||
jobs: | ||
Alert: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.12 | ||
- name: Install pipx | ||
run: python -m pip install pipx | ||
- name: Install gha-token | ||
run: python -m pipx install "git+https://github.com/hypothesis/gha-token.git" | ||
- name: Install dependabot-alerts | ||
run: python -m pipx install "git+https://github.com/hypothesis/dependabot-alerts.git" | ||
- name: Get GitHub token | ||
id: github_token | ||
run: echo GITHUB_TOKEN=$(gha-token --app-id 274948 --installation-id 32440510 --private-key "$PRIVATE_KEY") >> $GITHUB_OUTPUT | ||
env: | ||
PRIVATE_KEY: ${{ secrets.HYPOTHESIS_GITHUB_APP_PRIVATE_KEY }} | ||
- name: Check for alerts | ||
id: slack_message | ||
run: echo SLACK_MESSAGE=$(dependabot-alerts hypothesis) >> $GITHUB_OUTPUT | ||
env: | ||
GITHUB_TOKEN: ${{ steps.github_token.outputs.GITHUB_TOKEN }} | ||
- name: Post to Slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ vars.SLACK_CHANNEL }} | ||
slack-message: ${{ env.SLACK_MESSAGE }} | ||
env: | ||
SLACK_MESSAGE: ${{ steps.slack_message.outputs.SLACK_MESSAGE }} | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |