Skip to content

Update spec files

Update spec files #914

Workflow file for this run

name: Update spec files
on:
workflow_dispatch:
schedule:
# Runs at 12:00am UTC -> 5:00pm PDT
- cron: '0 0 * * *'
permissions: {}
jobs:
update:
name: update
runs-on: ubuntu-latest
permissions:
# Required to push updated spec files to this repo
contents: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.13' # Need python version for cache
cache: 'pip' # caching pip dependencies
- name: Cache GraphQL API IDs
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: specs/graphql_id_cache.json
# This key is overkill - we really only need to update the
# cache when a *new* spec file is added, not when *any* spec
# file changes. However, this seems to be the easiest way
# to achieve that from within Actions.
key: graphql-ids-${{ hashFiles('specs/*.spec') }}
# Make sure even if the specs change it grabs the old cache
# to start from! Entries are never invalidated, only added
restore-keys: graphql-ids
- name: Install dependencies
run: pip install -r requirements.txt
- name: Set git user to github-actions[bot]
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Check and update spec files
run: python -m autocopr.autocopr --verbose --in-place --push specs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}