Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
Internal to PayPal contributors should fill out this section. All others can delete.

PR should follow these steps before codeowners review will begin:
1. PR should be opened in a draft state with the `tech lead review required`, and `inner source` label
1. Comment `/inner source` on this PR — this will automatically add the `inner source` and `tech lead review required` labels. Open the PR in a draft state.
2. PR should be reviewed by and approved by your team's technical lead, we do not allow LGTM reviews, there should be comments and feedback provided on all PR reviews
3. Once the above steps are completed, the PR can be moved to ready to review with the `tech lead review required` label removed
3. Once the above steps are completed, comment `/ready` on this PR — this will automatically remove the `tech lead review required` label. Move the PR to ready to review.
4. PR comments must be addressed within 24 hours, if you are unable to address within this timeframe, move the PR back to a draft state so our team knows not to review

### Inner Source Checklist
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/inner-source-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Inner Source Labels

on:
issue_comment:
types: [created]

permissions:
issues: write
pull-requests: write

jobs:
add-inner-source-labels:
# Only fires on PR comments (not plain issues) containing the slash command
if: >
github.event.issue.pull_request != null &&
contains(github.event.comment.body, '/inner source')
runs-on: ubuntu-latest
steps:
- name: Acknowledge command
continue-on-error: true
uses: actions/github-script@v7
with:
script: |
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'eyes'
});

- name: Add inner source labels
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['inner source', 'tech lead review required']
});

remove-tech-lead-label:
# Only fires on PR comments containing the slash command
if: >
github.event.issue.pull_request != null &&
contains(github.event.comment.body, '/ready')
runs-on: ubuntu-latest
steps:
- name: Acknowledge command
continue-on-error: true
uses: actions/github-script@v7
with:
script: |
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'eyes'
});

- name: Remove tech lead review required label
uses: actions/github-script@v7
with:
script: |
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'tech lead review required'
});
} catch (e) {
// 404 means the label wasn't on the PR — that's fine
if (e.status !== 404) throw e;
}
Loading