diff --git a/README.md b/README.md index 69aaaa0..de7f0ee 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Default community health files (issue and pull request templates, security polic Files in `sync/files/` are pushed through a pull request to every non archived repository of the organization tagged with the `sync-org-files` topic; paths listed in `sync/delete.txt` are removed from them. Files in `sync/files-public/` are pushed the same way to public repositories only, and removed from private ones. -After each successful run of the automatic tag workflow, the synced `open-xml-update-pr.yml` workflow opens a pull request copying the `` block of the matching tag's plugin XML (`plugin.xml` or `.xml`) to the default branch, with the `GLPI_PROJECT_BOT` GitHub App, which needs the pull requests write permission. +After each successful run of the automatic tag workflow, the synced `open-xml-update-pr.yml` workflow opens a pull request copying the `` block of the matching tag's plugin XML (`plugin.xml` or `.xml`) to the default branch, with the `GLPI_PROJECT_BOT` GitHub App, which needs the pull requests write permission; the pull request is assigned to the author of the merged pull request that bumped the version. Issues labelled `need feedback` are closed by the stale workflow after 44 days without activity; the synced `need-feedback.yml` workflow removes the label when the issue author comments. Repository settings in `sync/settings.json` (any field of the [update a repository](https://docs.github.com/rest/repos/repos#update-a-repository) API) are applied directly to the same repositories, along with release immutability, Dependabot alerts and security updates, and private vulnerability reporting, secret scanning and push protection (public repositories only). The protection of the default branch and of `X.Y/bugfixes` branches is aligned on `sync/branch-protection.json` (body of the [update branch protection](https://docs.github.com/rest/branches/branch-protection#update-branch-protection) API). diff --git a/sync/files/.github/workflows/open-xml-update-pr.yml b/sync/files/.github/workflows/open-xml-update-pr.yml index 8fefaf9..19a713d 100644 --- a/sync/files/.github/workflows/open-xml-update-pr.yml +++ b/sync/files/.github/workflows/open-xml-update-pr.yml @@ -155,3 +155,10 @@ jobs: body: `Copies the \`${tag}\` version block from the tag's \`${xmlPath}\` to \`${base}\`, so that the plugins catalog lists it.`, }); core.info(`Opened PR: ${pull.html_url}`); + + // The bot authors the PR, assign it to the author of the release PR merged into the tagged branch + const { data: releasePulls } = await github.rest.repos.listPullRequestsAssociatedWithCommit({ owner, repo, commit_sha: process.env.HEAD_SHA }); + const releaseAuthor = releasePulls.find((releasePull) => releasePull.merged_at !== null)?.user.login; + if (releaseAuthor !== undefined) { + await github.rest.issues.addAssignees({ owner, repo, issue_number: pull.number, assignees: [releaseAuthor] }); + }