Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

update-graphql-files.yml 3.4 KB

You have to be logged in to leave a comment. Sign In
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  1. name: Update GraphQL files
  2. on:
  3. workflow_dispatch:
  4. schedule:
  5. - cron: '20 16 * * *' # run every day at 16:20 UTC / 8:20 PST
  6. # **IMPORTANT:** Do not change the FREEZE environment variable set here!
  7. # This workflow runs on a recurring basis. To temporarily disable it (e.g.,
  8. # during a docs deployment freeze), add an Actions Secret to the repo settings
  9. # called `FREEZE` with a value of `true`. To re-enable GraphQL updates, simply
  10. # delete that Secret from the repo settings. The environment variable here
  11. # will duplicate that Secret's value for later evaluation.
  12. env:
  13. FREEZE: ${{ secrets.FREEZE }}
  14. jobs:
  15. update_graphql_files:
  16. if: github.repository == 'github/docs-internal'
  17. runs-on: ubuntu-latest
  18. steps:
  19. - if: ${{ env.FREEZE == 'true' }}
  20. run: |
  21. echo 'The repo is currently frozen! Exiting this workflow.'
  22. exit 1 # prevents further steps from running
  23. - name: Checkout
  24. uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
  25. - name: Set up Ruby
  26. uses: ruby/setup-ruby@fdcfbcf14ec9672f6f615cb9589a1bc5dd69d262
  27. with:
  28. ruby-version: '2.4'
  29. - name: Install Ruby dependencies
  30. run: |
  31. gem install bundler
  32. bundle install
  33. - name: Install Node.js dependencies
  34. run: npm ci
  35. - name: Run updater scripts
  36. env:
  37. # need to use a token from a user with access to github/github for this step
  38. GITHUB_TOKEN: ${{ secrets.DOCS_BOT }}
  39. run: |
  40. script/graphql/update-files.js
  41. - name: Create pull request
  42. id: create-pull-request
  43. uses: peter-evans/create-pull-request@8c603dbb04b917a9fc2dd991dc54fef54b640b43
  44. with:
  45. # need to use a token with repo and workflow scopes for this step
  46. token: ${{ secrets.GITHUB_TOKEN }}
  47. commit-message: 'Action ran graphql script"update-files"'
  48. title: GraphQL schema update
  49. body:
  50. "Hello! Some GraphQL data in github/github was updated recently. This PR
  51. syncs up the GraphQL data in this repo.\n\n
  52. If CI passes, this PR will be auto-merged. :green_heart:\n\n
  53. If CI does not pass or other problems arise, contact #docs-engineering on slack."
  54. labels: automerge,autoupdate
  55. branch: graphql-schema-update
  56. - if: ${{ failure() }}
  57. name: Delete remote branch (if previous steps failed)
  58. uses: dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911
  59. with:
  60. github_token: ${{ secrets.GITHUB_TOKEN }}
  61. branches: graphql-schema-update
  62. - if: ${{ steps.create-pull-request.outputs.pull-request-number }}
  63. name: Approve
  64. uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8
  65. with:
  66. github-token: ${{ secrets.DOCUBOT_REPO_PAT }}
  67. number: ${{ steps.create-pull-request.outputs.pull-request-number }}
  68. - name: Send Slack notification if workflow fails
  69. uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
  70. if: failure()
  71. with:
  72. channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
  73. bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
  74. color: failure
  75. text: The last update-graphql-files run for ${{github.repository}} failed. See https://github.com/github/${{github.repository}}/actions/workflows/update-graphql-files.yml
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...