@@ -94,10 +94,28 @@ jobs:
9494 fi
9595 echo "::notice::User ${GITHUB_USERNAME} verified as member of ${GITHUB_ORG} organization"
9696
97+ - name : Determine issue URL
98+ id : determine-issue-url
99+ env :
100+ INPUTS_ISSUE_URL : ${{ inputs.issue_url }}
101+ GITHUB_EVENT_ISSUE_HTML_URL : ${{ github.event.issue.html_url }}
102+ GITHUB_EVENT_NAME : ${{ github.event_name }}
103+ run : |
104+ if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
105+ echo "issue_url=${INPUTS_ISSUE_URL}" >> "${GITHUB_OUTPUT}"
106+ exit 0
107+ elif [[ "${GITHUB_EVENT_NAME}" == "issues" ]]; then
108+ echo "issue_url=${GITHUB_EVENT_ISSUE_HTML_URL}" >> "${GITHUB_OUTPUT}"
109+ exit 0
110+ else
111+ echo "::error::Unsupported event type: ${GITHUB_EVENT_NAME}"
112+ exit 1
113+ fi
114+
97115 - name : Extract context key from issue
98116 id : extract-context
99117 env :
100- ISSUE_URL : ${{ inputs .issue_url }}
118+ ISSUE_URL : ${{ steps.determine-issue-url.outputs .issue_url }}
101119 GH_TOKEN : ${{ github.token }}
102120 run : |
103121 issue_number="$(gh issue view "${ISSUE_URL}" --json number --jq '.number')"
@@ -151,7 +169,7 @@ jobs:
151169 CONTEXT_KEY : ${{ steps.extract-context.outputs.context_key }}
152170 GH_TOKEN : ${{ github.token }}
153171 GITHUB_REPOSITORY : ${{ github.repository }}
154- ISSUE_URL : ${{ inputs .issue_url }}
172+ ISSUE_URL : ${{ steps.determine-issue-url.outputs .issue_url }}
155173 PREFIX : ${{ inputs.prefix }}
156174 RUN_ID : ${{ github.run_id }}
157175 TEMPLATE_PARAMETERS : ${{ secrets.TRAIAGE_TEMPLATE_PARAMETERS }}
@@ -207,7 +225,7 @@ jobs:
207225 CONTEXT_KEY : ${{ steps.extract-context.outputs.context_key }}
208226 GH_TOKEN : ${{ github.token }}
209227 GITHUB_REPOSITORY : ${{ github.repository }}
210- ISSUE_URL : ${{ inputs .issue_url }}
228+ ISSUE_URL : ${{ steps.determine-issue-url.outputs .issue_url }}
211229 TASK_NAME : ${{ steps.create-task.outputs.TASK_NAME }}
212230 run : |
213231 SUMMARY_FILE=$(mktemp)
0 commit comments