[Feature request] Allow adding PR reviewers via `publish:github:pull-request` action
See original GitHub issueWe’d like to be able to add reviewers to PRs created by Backstage via the publish:github:pull-request
action by setting them as parameters of the action.
Feature Suggestion
We’d like to have two extra parameters on the publish:github:pull-request
action, reviewers
and teamReviewers
, which would allow us to add reviewers much more easily to Backstage-created PRs just by adding them to the action definition:
- id: pullrequest
name: Create pull request
action: publish:github:pull-request
input:
repoUrl: ${{ parameters.repoUrl }}
branchName: ${{ parameters.branchName }}
title: New Pull Request
description: A newly created PR on GitHub
reviewers:
- user1
teamReviewers:
- team1
Possible Implementation
Currently, we have put together this code to perform this task:
const octokitIntegration = await new OctokitProvider(scmIntegrations).getOctokit(REPOSITORY_URL);
const prUrlSegments = pullRequestUrl.split("/");
await octokitIntegration.client.rest.pulls.requestReviewers({
owner: octokitIntegration.owner,
repo: octokitIntegration.repo,
pull_number: parseInt(prUrlSegments[prUrlSegments.length-1]),
reviewers: [...],
team_reviewers: [...]
});
where pullRequestUrl
is the remoteUrl
of the PR as returned by the publish:github:pull-request
action.
Context
We are using the publish:github:pull-request
action in our scaffolding process to propagate the creation of the new project to other repositories (mainly IaC-related) by sending PRs.
We need to add a team as a reviewer of these PRs so that those people get notified when Backstage sends a PR.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
@benjdlambert Can this be reopened? The feature request is still valid.
My colleague @fabuloso and I are working on it, we’ll open a PR next week.