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

Add created_pull_numbers output #404

Merged
merged 6 commits into from
Dec 16, 2023
Merged

Add created_pull_numbers output #404

merged 6 commits into from
Dec 16, 2023

Conversation

GuyAv46
Copy link
Contributor

@GuyAv46 GuyAv46 commented Dec 15, 2023

I decided to try my luck with JavaScript and implement the idea I suggested in #403

Feel free to suggest other options

@GuyAv46 GuyAv46 changed the title Add successful_prsoutput Add successful_prs output Dec 15, 2023
Copy link
Owner

@korthout korthout left a comment

Choose a reason for hiding this comment

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

Thanks for the excellent contribution, @GuyAv46 🙌 I like the idea of outputting data about the created pull request numbers.

In the future, users may request a key-value pair mapping between targets and the corresponding created pull request. But, I also see the usefulness of space delimiting the pull request numbers, which makes it easy to use in successive run steps. Like you do here:

# Draft and then undraft the pull requests to trigger CI
run: |
  for pr in ${{ steps.backport.outputs.successful_prs }}; do
    gh pr ready $pr --undo
    gh pr ready $pr
  done

Rather than complicating how to retrieve the set of values in your use case, such a key-value pair mapping could be added as an additional output later. So, let's go for your suggested approach!

I'll make some small adjustments, e.g. the naming of the output, and then merge this.

README.md Outdated
@@ -252,3 +252,4 @@ Output | Description
-------|------------
`was_successful` | Whether or not the changes could be backported successfully to all targets. Either `true` or `false`.
`was_successful_by_target` | Whether or not the changes could be backported successfully to all targets - broken down by target. Follows the pattern `{{label}}=true\|false`.
`successful_prs` | Space separated list of the newly created PRs.
Copy link
Owner

@korthout korthout Dec 16, 2023

Choose a reason for hiding this comment

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

I'd like to rename this to created_pull_numbers to allow further expansion of the number of outputs that may have some overlap with this one, e.g. an output that provides more data about the created pull requests or an output that provides data about the created issues.

This describes the output in more detail for clarification and allows
expansion through created_issues, created_pulls, etc.
@korthout korthout changed the title Add successful_prs output Add created_pull_numbers output Dec 16, 2023
@korthout korthout merged commit 518c779 into korthout:main Dec 16, 2023
1 check passed
@korthout korthout linked an issue Dec 16, 2023 that may be closed by this pull request
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.

Get The successful PR numbers as an output of the action
2 participants