Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 426f311

Browse files
author
Benjamin Muskalla
committed
Clarify model names and escape variables
1 parent 49d2fbf commit 426f311

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

.github/workflows/java-model-diff.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,35 @@ jobs:
2626
# ["FasterXML/jackson-core", "FasterXML/jackson-databind", "google/gson", "JodaOrg/joda-time"
2727
slug: ${{fromJson(github.event.inputs.projects || '["apache/commons-codec", "apache/commons-io", "apache/commons-beanutils", "apache/commons-logging", "apache/commons-fileupload", "apache/commons-lang", "apache/commons-validator", "apache/commons-csv", "apache/dubbo"]' )}}
2828
steps:
29-
- name: Clone self (github/codeql) for baseline
29+
- name: Clone self (github/codeql) for prhead
3030
uses: actions/checkout@v2
3131
if: github.event.pull_request
3232
with:
33-
path: codeql-baseline
33+
path: codeql-prhead
3434
ref: ${{ github.base_ref }}
35-
- name: Clone self (github/codeql) with new generator
35+
- name: Clone self (github/codeql) with main
3636
uses: actions/checkout@v2
3737
with:
3838
path: codeql-head
3939
ref: ${{ github.ref }}
40-
- uses: ./codeql-baseline/.github/actions/fetch-codeql
40+
- uses: ./codeql-head/.github/actions/fetch-codeql
4141
- name: Download database
4242
env:
4343
SLUG: ${{ matrix.slug }}
4444
run: |
4545
set -x
4646
mkdir lib-dbs
4747
SHORTNAME=${SLUG//[^a-zA-Z0-9_]/}
48-
projectId=`curl -s https://lgtm.com/api/v1.0/projects/g/${SLUG}} | jq .id`
48+
projectId=`curl -s https://lgtm.com/api/v1.0/projects/g/${SLUG} | jq .id`
4949
curl -L "https://lgtm.com/api/v1.0/snapshots/$projectId/java" -o "$SHORTNAME.zip"
50-
unzip -q -d $"SHORTNAME-db" "$SHORTNAME.zip"
50+
unzip -q -d "$SHORTNAME-db" "$SHORTNAME.zip"
5151
mkdir "lib-dbs/$SHORTNAME/"
5252
mv "$SHORTNAME-db/"`ls -1 "$SHORTNAME-db"`/* "lib-dbs/$SHORTNAME/"
53-
- name: Generate Models (Baseline and HEAD)
53+
- name: Generate Models (PR and HEAD)
5454
run: |
5555
set -x
5656
mkdir tmp-models
5757
MODELS=`pwd`/tmp-models
58-
MODE="baseline"
5958
DATABASES=`pwd`/lib-dbs
6059
6160
analyzeDatabaseWithCheckout() {
@@ -71,10 +70,10 @@ jobs:
7170
for d in $DATABASES/*/ ; do
7271
ls -1 "$d"
7372
74-
analyzeDatabaseWithCheckout "baseline" $d
73+
analyzeDatabaseWithCheckout "head" $d
7574
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]
7675
then
77-
analyzeDatabaseWithCheckout "head" $d
76+
analyzeDatabaseWithCheckout "prhead" $d
7877
fi
7978
done
8079
- name: Install diff2html
@@ -86,10 +85,10 @@ jobs:
8685
set -x
8786
MODELS=`pwd`/tmp-models
8887
ls -1 tmp-models/
89-
for m in $MODELS/*_baseline.qll ; do
90-
t="${m/baseline/"head"}"
88+
for m in $MODELS/*_prhead.qll ; do
89+
t="${m/prhead/"head"}"
9190
basename=`basename $m`
92-
name="diff_${basename/_baseline.qll/""}"
91+
name="diff_${basename/_prhead.qll/""}"
9392
(diff -w -u $m $t | diff2html -i stdin -F $MODELS/$name.html) || true
9493
done
9594
- uses: actions/upload-artifact@v2

0 commit comments

Comments
 (0)