From cd7b80e86996959b16cc26231d343abc27bb720c Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 5 May 2021 16:39:26 +0200 Subject: [PATCH] github: Make LGTM project ID configurable via environment variable --- .github/workflows/lgtm.yml | 1 + scripts/test.sh | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lgtm.yml b/.github/workflows/lgtm.yml index f527b2966..717af4711 100644 --- a/.github/workflows/lgtm.yml +++ b/.github/workflows/lgtm.yml @@ -30,6 +30,7 @@ jobs: # so we continue to use the approach we used on Travis - env: LGTM_TOKEN: ${{ secrets.LGTM_TOKEN }} + LGTM_PROJECT: ${{ secrets.LGTM_PROJECT }} BUILD_NUMBER: ${{ github.run_id }} COMMIT_ID: ${{ github.sha }} COMMIT_BASE: ${{ github.event.before }} diff --git a/scripts/test.sh b/scripts/test.sh index 97f1a352d..661b9b461 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -335,12 +335,11 @@ lgtm) base=$(git merge-base origin/master ${COMMIT_ID}) fi base=$(git rev-parse $base) - project_id=1506185006272 echo "Starting code review for $COMMIT_ID (base $base) on lgtm.com" git diff --binary $base > lgtm.patch || exit $? curl -s -X POST --data-binary @lgtm.patch \ - "https://lgtm.com/api/v1.0/codereviews/${project_id}?base=${base}&external-id=${BUILD_NUMBER}" \ + "https://lgtm.com/api/v1.0/codereviews/${LGTM_PROJECT}?base=${base}&external-id=${BUILD_NUMBER}" \ -H 'Content-Type: application/octet-stream' \ -H 'Accept: application/json' \ -H "Authorization: Bearer ${LGTM_TOKEN}" > lgtm.res || exit $? -- 2.39.5