whippet-application-tagger #9564
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
# Set schedule | |
name: whippet-application-tagger | |
on: | |
schedule: | |
- cron: 0 8-18 * * MON-FRI | |
jobs: | |
whippet-application-tagger: | |
runs-on: ubuntu-latest | |
steps: | |
- name: setup | |
uses: actions/checkout@v2 | |
- name: install GH CLI for local testing | |
if: ${{ env.ACT }} | |
run: | | |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null | |
sudo apt update | |
sudo apt install gh | |
- name: Authenticate with GitHub CLI | |
shell: bash | |
run: | | |
echo "${{ secrets.GOVPRESS_TOOLS_TOKEN }}" | gh auth login --with-token | |
- name: Run tagger script | |
run: | | |
bin/whippet-application-tagger.sh | |
- name: Keep workflow alive | |
uses: gautamkrishnar/keepalive-workflow@1.1.0 | |
with: | |
commit_message: Automated commit by Keepalive Workflow to keep the repository active [skip ci] | |
committer_username: dxw-govpress-tools | |
committer_email: team+govpress-tools@govpress.com | |
- name: Alert Slack if failure | |
if: ${{ failure() }} | |
uses: slackapi/slack-github-action@v1.23.0 | |
with: | |
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} # Slack channel id to post message | |
slack-message: "Our Whippet Application Tagger has failed. Check the workflow history for more information: https://github.com/dxw/whippet-application-tagger/blob/main/.github/workflows/main.yml, and see the documentation for possible causes: https://github.com/dxw/govpress-tools/blob/main/documentation/scheduled_tasks.md#investigating-failures" | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |