forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) · 1.85 KB
/
autoupdate-branch.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Autoupdate branch
# **What it does**: The next pull request in the merge queue will get its
# branch updated with main. Only updating one branch ensures that pull requests
# in the queue are merged sequentially.
# **Why we have it**: So we don't have to watch pull requests and click
# update branch 1000x.
# **Who does it impact**: Our health.
#
# The merge queue consists of any pull requests with automerge enabled and
# are mergeable. There is a label that can be used to skip to the front of
# the queue (`skip-to-front-of-merge-queue`).
#
# This workflow is triggered when a `push` event occurs ON the `main` branch
# (e.g. a PR was merged or a force-push was done).
#
# This workflow runs on all PRs created from source branches within the
# public and private docs repos but is won't work for PRs created from
# forked repos.
#
on:
push:
branches:
- main
permissions:
contents: read
# This allows a subsequently queued workflow run to take priority over
# previously queued runs but NOT interrupt currently executing runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: false
jobs:
autoupdate:
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
name: autoupdate
runs-on: ubuntu-latest
steps:
- name: Check out repo content
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748
- name: Setup Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561
with:
node-version: 16.14.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Update next PR in queue
env:
GITHUB_TOKEN: ${{ secrets.DOCUBOT_REPO_PAT }}
run: node .github/actions-scripts/update-merge-queue-branch.js