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

Governance pull request template daniel wong #3320

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/governance_pull_request_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Governance Team Pull Request Template

on:
pull_request:
types:
- opened
branches:
- master

jobs:
# TODO: Change this name to "main".
template:
runs-on: ubuntu-latest
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}

- name: Is the author a member of nns-team?
uses: tspascoal/get-user-teams-membership@v2
id: isAuthorInNnsTeam
with:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What value should I use here?

username: ${{ github.actor }}
team: nns-team

- name: Pre-populate pull request description.
if: ${{ steps.isAuthorInNnsTeam.isTeamMember == 'true' }}
uses: actions/github-script@v6
with:
github-token: ${{ github.token }}
script: |
const pullRequestId = context.pullRequest.id;
const template = 'Your custom template here';
await github.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pullRequestId,
body: template,
});
Loading