File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Fast-forwards the branch specified in BRANCH_NAME
2
+ # to the github.ref/sha that this workflow is run on.
3
+ # Used as part of the release process, to ensure
4
+ # external query writers can always access a branch of github/codeql
5
+ # that is compatible with the latest stable release.
6
+ name : Fast-forward tracking branch for selected CodeQL version
7
+ on :
8
+ workflow_dispatch :
9
+
10
+ jobs :
11
+ fast-forward :
12
+ name : Fast-forward tracking branch for selected CodeQL version
13
+ runs-on : ubuntu-latest
14
+ if : github.repository == 'github/codeql'
15
+ permissions :
16
+ contents : write
17
+ env :
18
+ BRANCH_NAME : ' lgtm.com'
19
+ steps :
20
+ - name : Validate chosen branch
21
+ if : ${{ !startsWith(github.ref_name, 'codeql-cli-') }}
22
+ shell : bash
23
+ run : |
24
+ echo "::error ::The $BRANCH_NAME tracking branch should only be fast-forwarded to the tip of a codeql-cli-* branch, got $GITHUB_REF_NAME instead."
25
+ exit 1
26
+
27
+ - name : Checkout
28
+ uses : actions/checkout@v3
29
+
30
+ - name : Git config
31
+ shell : bash
32
+ run : |
33
+ git config user.name "github-actions[bot]"
34
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
35
+
36
+ - name : Fetch
37
+ shell : bash
38
+ run : |
39
+ set -x
40
+ echo "Fetching $BRANCH_NAME"
41
+ # Explicitly unshallow and fetch to ensure the remote ref is available.
42
+ git fetch --unshallow origin "$BRANCH_NAME"
43
+ git checkout -b "$BRANCH_NAME" "origin/$BRANCH_NAME"
44
+
45
+ - name : Fast-forward
46
+ shell : bash
47
+ run : |
48
+ echo "Fast-forwarding $BRANCH_NAME to ${GITHUB_REF}@${GITHUB_SHA}"
49
+ git merge --ff-only "$GITHUB_SHA"
50
+ git push origin "$BRANCH_NAME"
You can’t perform that action at this time.
0 commit comments