Skip to content

Commit

Permalink
Add first attempt at alert.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
seanh committed Oct 24, 2023
1 parent 72b5601 commit 19e1c04
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/alert.yml
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 }}

0 comments on commit 19e1c04

Please sign in to comment.