Skip to content

Commit eefc486

Browse files
committed
Ruby: build query pack in temporary directory
This ensures we don't clobber any existing directories in the repo.
1 parent 999b12f commit eefc486

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

.github/workflows/ruby-build.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,22 @@ jobs:
116116
key: ruby-build
117117
- name: Build Query Pack
118118
run: |
119-
rm -rf query-packs
120-
codeql pack create ../misc/suite-helpers --output query-packs
121-
codeql pack create ../shared/regex --output query-packs
122-
codeql pack create ../shared/ssa --output query-packs
123-
codeql pack create ../shared/tutorial --output query-packs
124-
codeql pack create ql/lib --output query-packs
125-
codeql pack create -j0 ql/src --output query-packs --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
126-
PACK_FOLDER=$(readlink -f query-packs/codeql/ruby-queries/*)
119+
PACKS=${{ runner.temp }}/query-packs
120+
rm -rf $PACKS
121+
codeql pack create ../misc/suite-helpers --output $PACKS
122+
codeql pack create ../shared/regex --output $PACKS
123+
codeql pack create ../shared/ssa --output $PACKS
124+
codeql pack create ../shared/tutorial --output $PACKS
125+
codeql pack create ql/lib --output $PACKS
126+
codeql pack create -j0 ql/src --output $PACKS --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
127+
PACK_FOLDER=$(readlink -f $PACKS/codeql/ruby-queries/*)
127128
codeql generate query-help --format=sarifv2.1.0 --output="${PACK_FOLDER}/rules.sarif" ql/src
128129
(cd ql/src; find queries \( -name '*.qhelp' -o -name '*.rb' -o -name '*.erb' \) -exec bash -c 'mkdir -p "'"${PACK_FOLDER}"'/$(dirname "{}")"' \; -exec cp "{}" "${PACK_FOLDER}/{}" \;)
129130
- uses: actions/upload-artifact@v3
130131
with:
131132
name: codeql-ruby-queries
132133
path: |
133-
ruby/query-packs/*
134+
${{ runner.temp }}/query-packs/*
134135
retention-days: 1
135136

136137
package:

0 commit comments

Comments
 (0)