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
5 changes: 2 additions & 3 deletions .github/workflows/triage-issue.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Triage Issue

on:
# Only trigger this workflow manually for now
# issues:
# types: [opened]
issues:
types: [opened]
Comment on lines +4 to +5
Copy link

Choose a reason for hiding this comment

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

Bug: The workflow may fail when triggered by an issues event because INPUT_ISSUE_NUMBER is set from github.event.inputs.issue_number, which is undefined in that context.
Severity: HIGH

Suggested Fix

Provide a fallback value for the expression to prevent an evaluation error. Change INPUT_ISSUE_NUMBER: ${{ github.event.inputs.issue_number }} to INPUT_ISSUE_NUMBER: ${{ github.event.issue.number || github.event.inputs.issue_number || '' }}. This ensures the expression always evaluates successfully.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/triage-issue.yml#L4-L5

Potential issue: The GitHub Actions workflow is triggered by both `issues` and
`workflow_dispatch` events. The `INPUT_ISSUE_NUMBER` environment variable is set
directly from `${{ github.event.inputs.issue_number }}`. This property is only defined
for `workflow_dispatch` triggers. When the workflow runs on an `issues` event,
attempting to access this undefined property is likely to cause an expression evaluation
error, failing the workflow step before the script execution begins. This happens
despite the script's conditional logic, which would otherwise handle the value
correctly.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Member

Choose a reason for hiding this comment

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

I think this works anyway

Copy link
Member Author

Choose a reason for hiding this comment

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

yes it does. it uses the EVENT_ISSUE_NUMBER if it's triggered through issues.

          EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
          INPUT_ISSUE_NUMBER: ${{ github.event.inputs.issue_number }}
        run: |
          if [ "$EVENT_NAME" = "issues" ]; then
            ISSUE_NUM="$EVENT_ISSUE_NUMBER"
          else
            ISSUE_NUM="$INPUT_ISSUE_NUMBER"
          fi

workflow_dispatch:
inputs:
issue_number:
Expand Down
Loading