Commit Graph

6 Commits

Author SHA1 Message Date
Nestor Soriano 6fb769bc9d
Refactor the PR post-merge processing GitHub action
Common code has been extracted to a "post-request-shared.php" script.
2021-08-03 11:33:33 +02:00
Nestor Soriano b3617a3115
Extend post-merge GH action to add a comment suggestion next steps. 2021-08-03 10:07:24 +02:00
Nestor Soriano 9ffddbac1f
Use 'pull_request_target' in the automatic milestoning action
The original event used, 'pull_request', runs in the context of the
pull request. In the case of pull requests created from forks this means
that a read-only GitHub token is used for API calls, and thus the
call used to assign the milestone fails.

The fix is using the 'pull_request_target' event, which runs in the
context of the base branch, and thus with a read-write token. See:
https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target

Also, added a warning message when no milestone without a release
branch is found and thus the newest existing milestone is assigned
(this is a fallback that should normally not happen).
2021-07-29 16:47:27 +02:00
Nestor Soriano 68fcfa9cf6
Add logging to the GH action for assigning a milestone to merged PRs
If the GH API call to assign the milestone to a merged PR returns an
error, the data returned from the call will be dumped to the console,
and thus will be readable by looking at the action execution log.
2021-07-28 15:20:16 +02:00
Néstor Soriano 3ada9fc562
Change GH API query for milestones to get only the open ones.
Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2021-04-19 14:46:45 +02:00
Nestor Soriano a0c965964b
Add a GitHub action for automatic assignment of milestone to merged PRs
The milestone is chosen as follows:
1. List all the open milestones with a title of "X.Y.Z"
2. Sort them desc using verson_compare
3. foreach them in order, and take the last one not having a
   corresponding release branch ("release/X.Y")
2021-04-15 17:16:00 +02:00