-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: adds GH action that calculates rule diff
Fixes #266
- Loading branch information
Showing
4 changed files
with
674 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Rule Diff | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
diff: | ||
name: Generate diff | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the PR source | ||
uses: actions/checkout@v4 | ||
with: | ||
path: source | ||
- name: Checkout target ref ${{ github.base_ref }} | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.base_ref }} | ||
path: target | ||
- name: Use Node.js LTS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
|
||
- name: Determine npm cache directory windows | ||
id: npm-cache-dir-windows | ||
if: runner.os == 'Windows' | ||
run: echo "dir=$(npm config get cache)" >> $env:GITHUB_OUTPUT | ||
- name: Determine npm cache directory non-windows | ||
id: npm-cache-dir | ||
if: runner.os != 'Windows' | ||
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.npm-cache-dir-windows.outputs.dir || steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json', '**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: install the PR source | ||
run: 'npm ci --ignore-scripts --force' | ||
working-directory: ./source | ||
- name: install the PR target | ||
run: 'npm ci --ignore-scripts --force' | ||
working-directory: ./target | ||
|
||
- name: run eslint | ||
run: compare-eslint-configs .eslintrc ../target/.eslintrc -d -m --verbose-configs >> $GITHUB_STEP_SUMMARY | ||
working-directory: ./source |
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
Oops, something went wrong.