Skip to content

The get-merged-pr workflow sometimes gets empty output #1426

@qinsoon

Description

@qinsoon

get-merged-pr is triggered when a PR is merged to get its pull request number, and set the pull request number as the output for binding-refs to read and check what binding PRs are associated with it.

get-merged-pr:
runs-on: ubuntu-latest
outputs:
commit: ${{ steps.get-commit-hash.outputs.commit }}
pr: ${{ steps.get-pr.outputs.pr }}
steps:
- id: get-commit-hash
run: echo "commit=${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
- id: get-pr
run: |
PR_NUMBER=$(gh pr list --search "${GITHUB_SHA}" --state merged --repo mmtk/mmtk-core --json number --jq '.[0].number')
echo "pr=$PR_NUMBER" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

However, we saw this workflow failed to get the pull request number in https://github.com/mmtk/mmtk-core/actions/runs/19812966874/job/56860107289. I attempted a few reruns and it still failed.

I also saw this happened before once, but it worked after a rerun.

Will need to investigate the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-opsArea: Operations (e.g. CI)C-bugCategory: Bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions