Merge pull request #26 from dval-in/feat-better-schemas #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Convention | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: ["main"] | |
schedule: | |
- cron: "43 22 * * 3" | |
jobs: | |
commitlint: | |
name: Lint Commit Messages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install Commitlint | |
run: | | |
npm install --save-dev @commitlint/{config-conventional,cli} | |
- name: Lint Commit Messages | |
run: | | |
if [ "${{ github.event_name }}" = "pull_request" ]; then | |
npx commitlint --from=${{ github.event.pull_request.head.sha }} | |
else | |
npx commitlint --from=${{ github.sha }} | |
fi | |
eslint: | |
name: Run eslint scanning | |
needs: commitlint | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
security-events: write | |
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install ESLint | |
run: | | |
npm install [email protected] | |
npm install @microsoft/[email protected] | |
- name: Run ESLint | |
run: npx eslint . --ext .ts,.tsx |