Skip to content

Commit 6000046

Browse files
committed
Support codeql pack publish --allow-prerelease
1 parent 8b33cab commit 6000046

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/release-codeql.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,24 @@ jobs:
107107
env:
108108
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109109
run: |
110+
RELEASE_NAME="${{ steps.version.outputs.release_name }}"
111+
110112
# Read the shared pack list from the job-level environment variable.
111113
mapfile -t PUBLISHABLE_PACKS <<< "${PUBLISHABLE_PACKS_LIST}"
112114
115+
# Prerelease versions (containing a hyphen) require --allow-prerelease
116+
PRERELEASE_FLAG=""
117+
if [[ "${RELEASE_NAME}" == *-* ]]; then
118+
PRERELEASE_FLAG="--allow-prerelease"
119+
echo "Detected prerelease version — using ${PRERELEASE_FLAG}"
120+
fi
121+
113122
echo "Publishing CodeQL packs..."
114123
for pack_dir in "${PUBLISHABLE_PACKS[@]}"; do
115124
if [ -d "${pack_dir}" ]; then
116125
pack_name=$(grep -m1 "^name:" "${pack_dir}/qlpack.yml" | awk '{print $2}')
117126
echo "📦 Publishing ${pack_name} from ${pack_dir}..."
118-
echo "${GITHUB_TOKEN}" | codeql pack publish --github-auth-stdin --threads=-1 -- "${pack_dir}"
127+
codeql pack publish --threads=-1 ${PRERELEASE_FLAG} -- "${pack_dir}"
119128
echo "✅ Published ${pack_name}"
120129
else
121130
echo "⚠️ Skipping: ${pack_dir} not found"

0 commit comments

Comments
 (0)