-
Notifications
You must be signed in to change notification settings - Fork 251
34 lines (31 loc) · 1.11 KB
/
check-submodule-pointers.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
name: Check submodule pointers
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types:
- opened
- synchronize
- ready_for_review
- reopened
schedule:
- cron: '42 12 * * *'
jobs:
check-submodules:
runs-on: ubuntu-latest
if: github.repository == 'github/vscode-codeql-starter'
steps:
- uses: actions/checkout@v3
- name: Compare submodule pointers to lgtm.com branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
CODEQL_ACTUAL_SHA="$(git rev-parse @:./ql)"
CODEQL_EXPECTED_SHA="$(gh api repos/github/codeql/git/ref/heads/lgtm.com --jq '.object.sha')"
echo "The ql submodule currently points to $CODEQL_ACTUAL_SHA. The tip of the lgtm.com branch of github/codeql is $CODEQL_EXPECTED_SHA."
if [ "$CODEQL_EXPECTED_SHA" != "$CODEQL_ACTUAL_SHA" ]; then
echo "::error:: The ql submodule is out of date with the lgtm.com branch of github/codeql. Expected $CODEQL_EXPECTED_SHA, found $CODEQL_ACTUAL_SHA."
exit 1
fi