Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: return the number of the PR created as an output #78

Closed
xiehan opened this issue Jul 6, 2023 · 0 comments · Fixed by #83
Closed

Feature request: return the number of the PR created as an output #78

xiehan opened this issue Jul 6, 2023 · 0 comments · Fixed by #83
Labels
enhancement New feature or request

Comments

@xiehan
Copy link

xiehan commented Jul 6, 2023

From what I can tell, this is already available in the code, so it should hopefully be fairly easy to return it as an output.

pull_request_number = create_pull_request(

How to specify that an Action has outputs: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#outputs-for-docker-container-and-javascript-actions
End-to-end example including how to set the output: https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action

Use case: I have a process that needs to run on the PR that was created by this action. Right now I do:

prnumber=$(gh search prs --repo ${{ github.repository }} --state open --match title "$PR_TITLE" --json number --jq '.[].number')

... which works but is kinda janky. It'd be great if this action would just return the number of the PR that was created so I wouldn't have to do this extra step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants