From a54405e8aee7f9b5ecbabe82463f40488e71601d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 06:57:53 +0000 Subject: [PATCH] fix: skip failure notifications when upload_token is empty 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 --- action.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index a05c594..965ead6 100644 --- a/action.yml +++ b/action.yml @@ -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 + fi + - id: latest-release if: ${{ inputs.version_name == '' || inputs.release_note == '' }} uses: MirrorChyan/github-action-get-latest-release@master @@ -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" @@ -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' \