Skip to content

Update Blockers Meta #118

Update Blockers Meta

Update Blockers Meta #118

name: Update Blockers Meta
on:
push:
branches:
- "master"
- "v[0-9]+.[0-9]+.[0-9]+*"
paths:
- '.github/workflows/update-blockers.yml'
- "src/cshub/mkblockers.py"
- "pyproject.toml"
- "uv.lock"
- 'blockers/list.json'
schedule:
- cron: '0 6 * * *'
- cron: '0 18 * * *'
jobs:
update_blockers:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: checkout repo
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
version: 0.5.24
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: set up python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version-file: ".python-version"
- name: update blockers.json
run: |
uv sync --all-extras --dev --locked
uv run mkblockers
- name: Commit and push
env:
BRANCH_NAME: ${{ github.ref_name }}
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Update blockers meta" blockers.json || exit 0
git pull --rebase origin "$BRANCH_NAME"
git push origin "HEAD:$BRANCH_NAME"
invalidate-cache:
runs-on: ubuntu-latest
if: |
startsWith(github.ref, 'refs/heads/v') || github.ref == 'refs/heads/master'
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@517a711dbcd0e402f90c77e7e2f81e849156e31d # v6.2.2
with:
role-to-assume: ${{ secrets.CF_AWS_ROLE }}
role-session-name: github-action
aws-region: eu-west-1
- name: Get branch name
run: echo "version=${GITHUB_REF#refs/heads/}" >> "$GITHUB_ENV"
- name: Invalidate cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ID }} --paths "/${{ env.version }}/blockers.json"