Skip to content
This repository was archived by the owner on Apr 1, 2024. It is now read-only.

Commit b6b4b37

Browse files
authored
Merge pull request #11 from Code-Hex/add/updater-gh-schema
added new workflow to download schema
2 parents a82102c + 9b0e20a commit b6b4b37

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/update.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# https://github.com/octokit/graphql-schema/blob/master/.github/workflows/update.yml
2+
on:
3+
schedule:
4+
# https://crontab.guru/every-hour
5+
- cron: 0 * * * *
6+
workflow_dispatch: {}
7+
name: Update
8+
jobs:
9+
update:
10+
runs-on: ubuntu-latest
11+
env:
12+
TARGET_SCHEMA: example/github/schema.graphql
13+
steps:
14+
- uses: actions/checkout@v2
15+
- run: git checkout schema-update || true
16+
- run: |
17+
curl https://api.github.com/graphql \
18+
-H "Authorization: Bearer $GITHUB_TOKEN" \
19+
-H 'Accept: application/vnd.github.v4.idl' | jq --raw-output .data > $TARGET_SCHEMA
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
- name: create pull request
23+
uses: gr2m/create-or-update-pull-request-action@v1.x
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
title: "🚧 🤖📯 GraphQL Schema changed"
28+
body: |
29+
I found new changes in GitHub's GraphQL Schema 👋🤖
30+
I can't tell if the changes are fixes, features or breaking, you'll have to figure that out on yourself and adapt the commit messages accordingly to trigger the right release, see [our commit message conventions](https://github.com/octokit/openapi/blob/main/CONTRIBUTING.md#merging-the-pull-request--releasing-a-new-version).
31+
branch: "schema-update"
32+
path: env.TARGET_SCHEMA
33+
commit-message: "WIP: github schema.graphql changed - please review"
34+
labels: maintenance

0 commit comments

Comments
 (0)