mirror of
https://github.com/hohn/codeql-lab.git
synced 2025-12-16 18:03:08 +01:00
Update workflow that checks submodules
This commit is contained in:
@@ -4,6 +4,8 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '42 12 * * *'
|
- cron: '42 12 * * *'
|
||||||
|
|
||||||
@@ -20,6 +22,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
CODEQL_ACTUAL_SHA="$(git rev-parse @:./ql)"
|
CODEQL_ACTUAL_SHA="$(git rev-parse @:./ql)"
|
||||||
CODEQL_EXPECTED_SHA="$(gh api repos/github/codeql/git/ref/heads/lgtm.com --jq '.object.sha')"
|
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
|
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."
|
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
|
exit 1
|
||||||
@@ -27,6 +30,7 @@ jobs:
|
|||||||
|
|
||||||
CODEQL_GO_ACTUAL_SHA="$(git rev-parse @:./codeql-go)"
|
CODEQL_GO_ACTUAL_SHA="$(git rev-parse @:./codeql-go)"
|
||||||
CODEQL_GO_EXPECTED_SHA="$(gh api repos/github/codeql-go/git/ref/heads/lgtm.com --jq '.object.sha')"
|
CODEQL_GO_EXPECTED_SHA="$(gh api repos/github/codeql-go/git/ref/heads/lgtm.com --jq '.object.sha')"
|
||||||
|
echo "The codeql-go submodule currently points to $CODEQL_GO_ACTUAL_SHA. The tip of the lgtm.com branch of github/codeql-go is $CODEQL_GO_EXPECTED_SHA."
|
||||||
if [ "$CODEQL_GO_EXPECTED_SHA" != "$CODEQL_GO_ACTUAL_SHA" ]; then
|
if [ "$CODEQL_GO_EXPECTED_SHA" != "$CODEQL_GO_ACTUAL_SHA" ]; then
|
||||||
echo "::error:: The codeql-go submodule is out of date with the lgtm.com branch of github/codeql-go. Expected $CODEQL_GO_EXPECTED_SHA, found $CODEQL_GO_ACTUAL_SHA."
|
echo "::error:: The codeql-go submodule is out of date with the lgtm.com branch of github/codeql-go. Expected $CODEQL_GO_EXPECTED_SHA, found $CODEQL_GO_ACTUAL_SHA."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user