fix: skip failure notifications when upload_token is empty#2
Conversation
Co-authored-by: MistEO <18511905+MistEO@users.noreply.github.com> Agent-Logs-Url: https://github.com/MirrorChyan/release-note-action/sessions/3190412d-4841-49e0-966f-8f91bb7695b9
There was a problem hiding this comment.
Pull request overview
Updates the composite GitHub Action to treat an empty upload_token as a configuration error and avoid triggering failure-notification automation for that scenario.
Changes:
- Added an initial
check-tokenstep that errors and exits whenupload_tokenis empty. - Gated the “Create issue if failed” and “Notify admin if failed” steps on
failure()andsteps.check-token.outcome == 'success'.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| env: | ||
| UPLOAD_TOKEN: ${{ inputs.upload_token }} | ||
| run: | | ||
| if [[ -z "$UPLOAD_TOKEN" ]]; then | ||
| echo "::error::upload_token is required but was not provided" | ||
| exit 1 |
There was a problem hiding this comment.
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.
When
upload_tokenis empty, the upload step fails and incorrectly triggers the admin notification and issue-creation steps. These should only fire on real upload failures, not misconfiguration.Changes
check-tokenstep — added as the first step; emits::error::and exits early ifupload_tokenis empty. Token passed viaenv:to avoid shell injection.if: failure()conditions now also requiresteps.check-token.outcome == 'success', so they are skipped when the failure is due to an empty token.Summary by Sourcery
Bug Fixes:
upload_token输入缺失或为空时仍然运行失败通知和创建 issue 的逻辑。Original summary in English
Summary by Sourcery
Bug Fixes:
Original summary in English
Summary by Sourcery
Bug Fixes:
upload_token输入缺失或为空时仍然运行失败通知和创建 issue 的逻辑。Original summary in English
Summary by Sourcery
Bug Fixes: