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

Return the created PR from the action #14

Merged
merged 1 commit into from
Feb 21, 2021

Conversation

russell
Copy link
Contributor

@russell russell commented Feb 18, 2021

Return the PR number and URL so that we can use them in other actions

My current use case for this is that i want to assign the PR to people and add labels, it's easy to do this in other steps if i know what the PR is, otherwise i have to go and look it up again

Return the PR number and URL so that we can use them in other actions
Copy link
Owner

@timbertson timbertson left a comment

Choose a reason for hiding this comment

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

Looks good, thanks

Comment on lines +16 to +19
console.log(`Setting output pr_number=${pr.number}`)
core.setOutput('pr_number', pr.number.toString())
console.log(`Setting output pr_url=${pr.url}`)
core.setOutput('pr_url', pr.url)
Copy link
Owner

Choose a reason for hiding this comment

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

Nit: we can drop the logging lines, we already log the PR URL when we create/update it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess it depends how much you trust the program.

Since Github has no validation on any output, you can specify steps.upgrade.outputs.pr and it won't error, it can be hard to trace issues especially since the setting of this output is conditional.

I don't mind removing them, but i have found it helpful when working with other actions to know what they are doing

Copy link
Owner

Choose a reason for hiding this comment

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

Ah yep, so it's more about debugging the keys that are being set rather than the values. Makes sense 👍

@timbertson timbertson merged commit c6e6549 into timbertson:main Feb 21, 2021
@russell russell deleted the rsim.return-pr-as-output branch March 7, 2022 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants