Skip to content

Commit b494190

Browse files
authored
Merge pull request #2726 from github/aeisenberg/reenable-artifact-upload
Ensure artifacts are only uploaded in safe situations
2 parents c6b2861 + a879704 commit b494190

21 files changed

+300
-60
lines changed

.github/workflows/debug-artifacts-failure.yml .github/workflows/debug-artifacts-failure-safe.yml

+28-17
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ on:
1919
workflow_dispatch: {}
2020
jobs:
2121
upload-artifacts:
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
version:
26+
- stable-v2.20.3
27+
- default
28+
- linked
29+
- nightly-latest
2230
name: Upload debug artifacts after failure in analyze
2331
continue-on-error: true
2432
env:
@@ -36,7 +44,7 @@ jobs:
3644
id: prepare-test
3745
uses: ./.github/actions/prepare-test
3846
with:
39-
version: linked
47+
version: ${{ matrix.version }}
4048
- uses: actions/setup-go@v5
4149
with:
4250
go-version: ^1.13.1
@@ -70,22 +78,25 @@ jobs:
7078
shell: bash
7179
run: |
7280
LANGUAGES="cpp csharp go java javascript python"
73-
cd "./my-debug-artifacts"
74-
echo "Artifacts from run:"
75-
for language in $LANGUAGES; do
76-
echo "- Checking $language"
77-
if [[ ! -f "my-db-$language-partial.zip" ]] ; then
78-
echo "Missing a partial database bundle for $language"
79-
exit 1
80-
fi
81-
if [[ ! -d "log" ]] ; then
82-
echo "Missing database initialization logs"
83-
exit 1
84-
fi
85-
if [[ ! "$language" == "go" ]] && [[ ! -d "$language/log" ]] ; then
86-
echo "Missing logs for $language"
87-
exit 1
88-
fi
81+
for version in $VERSIONS; do
82+
echo "Artifacts from version $version:"
83+
pushd "./my-debug-artifacts-${version//./}"
84+
for language in $LANGUAGES; do
85+
echo "- Checking $language"
86+
if [[ ! -f "my-db-$language-partial.zip" ]] ; then
87+
echo "Missing a partial database bundle for $language"
88+
exit 1
89+
fi
90+
if [[ ! -d "log" ]] ; then
91+
echo "Missing database initialization logs"
92+
exit 1
93+
fi
94+
if [[ ! "$language" == "go" ]] && [[ ! -d "$language/log" ]] ; then
95+
echo "Missing logs for $language"
96+
exit 1
97+
fi
98+
done
99+
popd
89100
done
90101
env:
91102
GO111MODULE: auto

.github/workflows/debug-artifacts.yml .github/workflows/debug-artifacts-safe.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
version:
25-
- stable-v2.15.5
26-
- stable-v2.16.6
27-
- stable-v2.17.6
28-
- stable-v2.18.4
29-
- stable-v2.19.4
25+
- stable-v2.20.3
3026
- default
3127
- linked
3228
- nightly-latest
@@ -75,7 +71,7 @@ jobs:
7571
- name: Check expected artifacts exist
7672
shell: bash
7773
run: |
78-
VERSIONS="stable-v2.15.5 stable-v2.16.6 stable-v2.17.6 stable-v2.18.4 stable-v2.19.4 default linked nightly-latest"
74+
VERSIONS="stable-v2.20.3 default linked nightly-latest"
7975
LANGUAGES="cpp csharp go java javascript python"
8076
for version in $VERSIONS; do
8177
pushd "./my-debug-artifacts-${version//./}"

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
44

55
## [UNRELEASED]
66

7-
No user facing changes.
7+
- Re-enable debug artifact upload for CLI versions 2.20.3 or greater. [#2726](https://github.com/github/codeql-action/pull/2726)
88

99
## 3.28.5 - 24 Jan 2025
1010

lib/analyze-action-post.js

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action-post.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/debug-artifacts.js

+15-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)