Skip to content

Commit

Permalink
Merge pull request #10841 from Expensify/andrew-checklist-3
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham authored Sep 6, 2022
2 parents 4f83fb2 + 4c84ee9 commit 27d5bc7
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .github/actions/javascript/contributorChecklist/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inputs:
GITHUB_TOKEN:
description: Auth token for New Expensify Github
required: true
CHECKLIST:
description: The checklist to look for, either 'contributor' or 'contributorPlus'
required: true
runs:
using: 'node16'
main: './index.js'
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ const completedContributorPlusChecklist = `- [x] I have verified the author chec
- [x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
- [x] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.`;

// True if we are validating a contributor checklist, otherwise we are validating a contributor+ checklist
const verifyingContributorChecklist = core.getInput('CHECKLIST', {required: true}) === 'contributor';
const issue = github.context.payload.issue ? github.context.payload.issue.number : github.context.payload.pull_request.number;
const combinedData = [];

Expand Down Expand Up @@ -150,17 +152,17 @@ getPullRequestBody()
}
}

if (!contributorChecklistComplete) {
if (verifyingContributorChecklist && !contributorChecklistComplete) {
console.log('Make sure you are using the most up to date checklist found here: https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md');
core.setFailed('Contributor checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.');
return;
}

if (!contributorPlusChecklistComplete) {
if (!verifyingContributorChecklist && !contributorPlusChecklistComplete) {
console.log('Make sure you are using the most up to date checklist found here: https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md');
core.setFailed('Contributor plus checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.');
core.setFailed('Contributor+ checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.');
return;
}

console.log('All checklists are complete 🎉');
console.log(`${verifyingContributorChecklist ? 'Contributor' : 'Contributor+'} checklist is complete 🎉`);
});
10 changes: 6 additions & 4 deletions .github/actions/javascript/contributorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ const completedContributorPlusChecklist = `- [x] I have verified the author chec
- [x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
- [x] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.`;

// True if we are validating a contributor checklist, otherwise we are validating a contributor+ checklist
const verifyingContributorChecklist = core.getInput('CHECKLIST', {required: true}) === 'contributor';
const issue = github.context.payload.issue ? github.context.payload.issue.number : github.context.payload.pull_request.number;
const combinedData = [];

Expand Down Expand Up @@ -160,19 +162,19 @@ getPullRequestBody()
}
}

if (!contributorChecklistComplete) {
if (verifyingContributorChecklist && !contributorChecklistComplete) {
console.log('Make sure you are using the most up to date checklist found here: https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md');
core.setFailed('Contributor checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.');
return;
}

if (!contributorPlusChecklistComplete) {
if (!verifyingContributorChecklist && !contributorPlusChecklistComplete) {
console.log('Make sure you are using the most up to date checklist found here: https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md');
core.setFailed('Contributor plus checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.');
core.setFailed('Contributor+ checklist is not completely filled out. Please check every box to verify you\'ve thought about the item.');
return;
}

console.log('All checklists are complete 🎉');
console.log(`${verifyingContributorChecklist ? 'Contributor' : 'Contributor+'} checklist is complete 🎉`);
});


Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/contributorChecklists.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Contributor Checklist

on: pull_request

jobs:
checklist:
runs-on: ubuntu-latest
if: github.actor != 'OSBotify' && (github.event_name == 'pull_request' && contains(github.event.pull_request.body, '- ['))
steps:
- name: contributorChecklist.js
uses: Expensify/App/.github/actions/javascript/contributorChecklist@andrew-checklist-3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHECKLIST: 'contributor'
14 changes: 14 additions & 0 deletions .github/workflows/contributorPlusChecklists.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Contributor+ Checklist

on: issue_comment

jobs:
checklist:
runs-on: ubuntu-latest
if: github.actor != 'OSBotify' && (contains(github.event.issue.pull_request.url, 'http') && github.event_name == 'issue_comment' && contains(github.event.comment.body, '- ['))
steps:
- name: contributorChecklist.js
uses: Expensify/App/.github/actions/javascript/contributorChecklist@andrew-checklist-3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHECKLIST: 'contributorPlus'
20 changes: 0 additions & 20 deletions .github/workflows/testChecklists.yml

This file was deleted.

0 comments on commit 27d5bc7

Please sign in to comment.