Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 5

29 changes: 29 additions & 0 deletions .github/workflows/dependabot-auto-merge-auto-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Dependabot - auto-merge & auto-approve
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: '[Dependabot] Fetch metadata for PR#${{github.event.pull_request.number}}'
id: metadata
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'

- name: '[Dependabot] Enable auto-merge for PR#${{github.event.pull_request.number}}'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: '[Dependabot] Approve PR for PR#${{github.event.pull_request.number}}'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
46 changes: 46 additions & 0 deletions .github/workflows/update-github-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Update GitHub API Cache

on:
schedule:
- cron: '0 0 1 * *' # Runs at 00:00 on the 1st of every month
workflow_dispatch:

jobs:
update-cache:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip

- name: Run api_process.py
run: python api_process.py

- name: Check for changes
id: git-check
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add js/cached-github-api-response.js
echo "changed=$(git diff --cached --quiet && echo 'false' || echo 'true')" >> $GITHUB_OUTPUT

- name: Commit and push if changed
if: steps.git-check.outputs.changed == 'true'
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git commit -m "Regenerating cached GitHub API response - $(date +'%Y-%m-%d')" js/cached-github-api-response.js
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}