Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ outputs:
runs:
using: "composite"
steps:
- name: Check upload token
id: check-token
shell: bash
env:
UPLOAD_TOKEN: ${{ inputs.upload_token }}
run: |
if [[ -z "$UPLOAD_TOKEN" ]]; then
echo "::error::upload_token is required but was not provided"
exit 1
Comment on lines +46 to +51

Copilot AI Mar 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says the token is passed via env: to avoid shell injection, but later steps still interpolate ${{ inputs.upload_token }} directly into shell commands (e.g., the Python invocation and the curl --header 'Authorization: ...'). If upload_token ever contains characters like quotes/newlines, this can break quoting and reintroduce injection/logging risk. Consider passing the token via env: for those steps too and referencing it as "$UPLOAD_TOKEN" in the script/arguments.

Copilot uses AI. Check for mistakes.
fi

- id: latest-release
if: ${{ inputs.version_name == '' || inputs.release_note == '' }}
uses: MirrorChyan/github-action-get-latest-release@master
Expand Down Expand Up @@ -92,7 +103,7 @@ runs:
python mirrorchyan_release_note.py '${{ inputs.mirrorchyan_rid }}' '${{ inputs.upload_token }}' body.json

- name: Create issue if failed
if: failure()
if: failure() && steps.check-token.outcome == 'success'
uses: actions-cool/issues-helper@v3
with:
actions: "create-issue"
Expand All @@ -103,7 +114,7 @@ runs:
@MistEO @Aliothmoon @dongwlin

- name: Notify admin if failed
if: failure()
if: failure() && steps.check-token.outcome == 'success'
shell: bash
run: |
curl -L -X POST 'https://dev.mirrorchyan.com/api/misc/notify_admin?dev=1' \
Expand Down
Loading