-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.23 KB
/
update-schemas.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
jobs:
test:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
extra_nix_config: accept-flake-config = true
- uses: cachix/cachix-action@v14
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
name: nickel-schemastore
- env:
GH_TOKEN: ${{ github.token }}
name: Update the schemas from upstream
run: |-
nix develop --command python3 ./extract-schemas.py
if ! git diff --exit-code; then
BRANCH_NAME=update-schemas-from-$GITHUB_RUN_ID
git checkout -b "$BRANCH_NAME"
git add .
git config user.name "Schemas update bot"
git config user.email "noreply@schemaupdate.invalid"
git commit --message="Re-generate the schema files"
git push origin "$BRANCH_NAME"
nix run --inputs-from . nixpkgs\#gh -- pr create \
--head "$BRANCH_NAME" \
--title "Re-generate the schema files" \
--body "Automated update from $GITHUB_RUN_ID"
fi
on:
schedule:
- cron: 0 0 * * 0
workflow_dispatch: {}