Fetch Beer Data #762
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
name: Fetch Beer Data | |
# ┌───────────── minute (0 - 59) | |
# │ ┌───────────── hour (0 - 23) | |
# │ │ ┌───────────── day of the month (1 - 31) | |
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# * * * * * | |
on: | |
schedule: | |
- cron: "21 2 * * *" # Every day at 2:21am | |
workflow_dispatch: {} | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
PR_BOT_AUTHOR: quack-bot[bot] <98925477+quack-bot[bot]@users.noreply.github.com> | |
jobs: | |
fetch-beer-data: | |
name: Fetch Beer Data | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Install Deno | |
uses: denoland/setup-deno@v1 | |
- name: Fetch Recent Checkins | |
id: fetch_recent_checkins | |
run: deno task fetch-recent-checkins | |
env: | |
UNTAPPD_CLIENT_ID: ${{ secrets.UNTAPPD_CLIENT_ID }} | |
UNTAPPD_CLIENT_SECRET: ${{ secrets.UNTAPPD_CLIENT_SECRET }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
if: ${{ steps.fetch_recent_checkins.outputs.NEW_CHECKIN_COUNT != 0 }} | |
with: | |
token: ${{ secrets.BEERS_CR_PAT }} | |
commit-message: | | |
auto: [Beers] - Daily Beer Update | |
committer: ${{ env.PR_BOT_AUTHOR }} | |
author: ${{ env.PR_BOT_AUTHOR }} | |
title: "[Beers] - You Drank ${{ steps.fetch_recent_checkins.outputs.NEW_CHECKIN_COUNT }} new beer${{ steps.fetch_recent_checkins.outputs.NEW_CHECKIN_COUNT != 1 && 's' || '' }}!" | |
labels: "A:Auto Merge" | |
branch: "new-beers" | |
branch-suffix: "short-commit-hash" | |
delete-branch: true | |
body: | | |
Generated by `${{github.actor}}` via ${{github.sha}} |