|
1 | 1 | name: Update GraphQL files |
2 | 2 |
|
3 | | -# **IMPORTANT:** Do not change the FREEZE environment variable set here. |
4 | | -# This workflow runs every hour. To temporarily disable it (for example, during |
5 | | -# a docs freeze), add a secret to the docs repo settings called `FREEZE` |
6 | | -# with a value of `true`. To reenable GraphQL updates, delete the secret in |
7 | | -# the repo settings. The env variable here will evaluate whether the secret exists. |
8 | | -env: |
9 | | - FREEZE: ${{ secrets.FREEZE }} |
10 | | - |
11 | 3 | on: |
12 | 4 | workflow_dispatch: |
13 | 5 | schedule: |
14 | 6 | - cron: '20 16 * * *' # run every day at 16:20 UTC / 8:20 PST |
15 | 7 |
|
| 8 | +# **IMPORTANT:** Do not change the FREEZE environment variable set here! |
| 9 | +# This workflow runs on a recurring basis. To temporarily disable it (e.g., |
| 10 | +# during a docs deployment freeze), add an Actions Secret to the repo settings |
| 11 | +# called `FREEZE` with a value of `true`. To re-enable GraphQL updates, simply |
| 12 | +# delete that Secret from the repo settings. The environment variable here |
| 13 | +# will duplicate that Secret's value for later evaluation. |
| 14 | +env: |
| 15 | + FREEZE: ${{ secrets.FREEZE }} |
| 16 | + |
16 | 17 | jobs: |
17 | 18 | update_graphql_files: |
18 | 19 | if: github.repository == 'github/docs-internal' |
|
25 | 26 | - name: Checkout |
26 | 27 | uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f |
27 | 28 | - name: Set up Ruby |
28 | | - uses: actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526 |
| 29 | + uses: ruby/setup-ruby@fdcfbcf14ec9672f6f615cb9589a1bc5dd69d262 |
29 | 30 | with: |
30 | 31 | ruby-version: '2.4' |
31 | 32 | - name: Install Ruby dependencies |
|
37 | 38 | - name: Run updater scripts |
38 | 39 | env: |
39 | 40 | # need to use a token from a user with access to github/github for this step |
40 | | - GITHUB_TOKEN: ${{ secrets.RACHMARI_REPO_WORKFLOW }} |
| 41 | + GITHUB_TOKEN: ${{ secrets.DOCS_BOT }} |
41 | 42 | run: | |
42 | 43 | script/graphql/update-files.js |
43 | 44 | - name: Create pull request |
|
53 | 54 | syncs up the GraphQL data in this repo.\n\n |
54 | 55 | If CI passes, this PR will be auto-merged. :green_heart:\n\n |
55 | 56 | If CI does not pass or other problems arise, contact #docs-engineering on slack." |
56 | | - labels: automerge |
| 57 | + labels: automerge,autoupdate |
57 | 58 | branch: graphql-schema-update |
58 | 59 | - if: ${{ failure() }} |
59 | 60 | name: Delete remote branch (if previous steps failed) |
|
65 | 66 | name: Approve |
66 | 67 | uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8 |
67 | 68 | with: |
68 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + github-token: ${{ secrets.DOCUBOT_REPO_PAT }} |
69 | 70 | number: ${{ steps.create-pull-request.outputs.pull-request-number }} |
| 71 | + - name: Send Slack notification if workflow fails |
| 72 | + uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd |
| 73 | + if: failure() |
| 74 | + with: |
| 75 | + channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} |
| 76 | + bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} |
| 77 | + color: failure |
| 78 | + text: The last update-graphql-files run for ${{github.repository}} failed. See https://github.com/github/${{github.repository}}/actions/workflows/update-graphql-files.yml |
0 commit comments