Skip to content

Update WQX

Update WQX #214

Workflow file for this run

name: Update WQX
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 6'
permissions:
contents: write
jobs:
update:
name: Update
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Node.js 22.x
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22.x
registry-url: 'https://registry.npmjs.org'
- name: Cache npm
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: |
npm install
- name: Download and rebuild allowed values
run: |
npm run download
npm run build
npm run lint
- name: Check for file changes
run: |
git status --porcelain
echo "change=$(git status --porcelain | wc -l)" >> $GITHUB_ENV
- if: env.change != 0
name: Commit & push changes
run: |
git config --local user.name ${{ github.actor }}
git config --local user.email [email protected]
git add -A
git commit -a -m 'ci: update allowed values'
npm version patch -m 'chore: bump version to %s'
git push "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:${GITHUB_REF#refs/*/} --follow-tags --force --tags
- if: env.change != 0
name: Publish
run: |
cp package.json dist/package.json
cd ./dist
npm publish
env:
NPM_CONFIG_PROVENANCE: 'true'
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# -
# if: env.change != 0
# name: Trigger @gordonfn/data-schema rebuild
# run: |
# curl -X POST https://api.github.com/repos/gordonfn/schema/dispatches \
# -H 'Accept: application/vnd.github.everest-preview+json' \
# -u ${{ secrets.GITHUB_TOKEN }} \
# --data '{"event_type": "wqx", "client_payload": {}'