Skip to content

Commit fe1dcae

Browse files
fix: address CodeQL security warnings in zapstore workflow
- Remove ref: head_sha from checkout to avoid untrusted code execution - Move head_branch and head_sha to env vars to prevent code injection Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
1 parent 7e66412 commit fe1dcae

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/zapstore-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
with:
18-
ref: ${{ github.event.workflow_run.head_sha }}
1918
sparse-checkout: |
2019
zapstore.yaml
2120
frontend/src-tauri/icons/icon.png
2221
2322
- name: Download APK from release
2423
env:
2524
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
TAG: ${{ github.event.workflow_run.head_branch }}
2626
run: |
27-
TAG="${{ github.event.workflow_run.head_branch }}"
2827
gh release download "$TAG" \
2928
--pattern "app-universal-release.apk" \
3029
--dir .
@@ -42,6 +41,7 @@ jobs:
4241
- name: Publish to Zapstore
4342
env:
4443
SIGN_WITH: ${{ secrets.ZAPSTORE_SIGN_WITH }}
44+
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
4545
run: |
4646
if [ -z "${SIGN_WITH}" ]; then
4747
echo "Missing required secret: ZAPSTORE_SIGN_WITH" >&2
@@ -51,5 +51,5 @@ jobs:
5151
zsp publish \
5252
-y \
5353
--skip-preview \
54-
--commit "${{ github.event.workflow_run.head_sha }}" \
54+
--commit "$COMMIT_SHA" \
5555
zapstore.yaml

0 commit comments

Comments
 (0)