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

Split up C and C+ checklists into two different tests #10841

Merged
merged 3 commits into from
Sep 6, 2022
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
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.