Skip to content

Commit

Permalink
Merge pull request #1 from Expensify/tgolen-implement-workflows
Browse files Browse the repository at this point in the history
Add lint and CLA workflows
  • Loading branch information
neil-marcellini authored Jul 24, 2023
2 parents 1c9958d + 8209e1b commit 8a5bef3
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit. -->

### Details
<!-- Explanation of the change or anything fishy that is going on -->

### Related Issues
<!-- Please replace GH_LINK with the link to the GitHub issue this Pull Request is related to -->
GH_LINK

### Manual Tests
<!---
Most changes should have accompanying tests. Describe the tests you added or if no tests were added an explanation about why one was not needed.
--->

### Linked PRs
<!---
Please include links to any update PRs in repos that must change their package.json version.
--->
39 changes: 39 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CLA Assistant

on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]

jobs:
CLA:
runs-on: ubuntu-latest
# This job only runs for pull request comments or pull request target events (not issue comments)
if: github.event.issue.pull_request || github.event_name == 'pull_request_target'
steps:
- uses: actions-ecosystem/action-regex-match@9c35fe9ac1840239939c59e5db8839422eed8a73
id: sign
with:
text: ${{ github.event.comment.body }}
regex: '\s*I have read the CLA Document and I hereby sign the CLA\s*'
- uses: actions-ecosystem/action-regex-match@9c35fe9ac1840239939c59e5db8839422eed8a73
id: recheck
with:
text: ${{ github.event.comment.body }}
regex: '\s*recheck\s*'
- name: CLA Assistant
if: ${{ steps.recheck.outputs.match != '' || steps.sign.outputs.match != '' }} || github.event_name == 'pull_request_target'
# Version: 2.1.2-beta
uses: cla-assistant/github-action@948230deb0d44dd38957592f08c6bd934d96d0cf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN : ${{ secrets.CLA_BOTIFY_TOKEN }}
with:
path-to-signatures: '${{ github.repository }}/cla.json'
path-to-document: 'https://github.com/${{ github.repository }}/blob/main/CLA.md'
branch: 'main'
remote-organization-name: 'Expensify'
remote-repository-name: 'CLA'
lock-pullrequest-aftermerge: false
allowlist: 'snyk-bot,OSBotify'
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Lint JavaScript

on:
pull_request:
types: [opened, synchronize]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "16.x"

- run: npm ci

- run: npm run lint
env:
CI: true


- name: Verify there's no Prettier diff
run: |
npm run prettier -- --loglevel silent
if ! git diff --name-only --exit-code; then
# shellcheck disable=SC2016
echo 'Error: Prettier diff detected! Please run `npm run prettier` and commit the changes.'
exit 1
fi

0 comments on commit 8a5bef3

Please sign in to comment.