Skip to content

Commit

Permalink
[DT-1250][risk=no] Check for lint in the files that have changed betw…
Browse files Browse the repository at this point in the history
…een this PR and the destination branch. (#2791)

Co-authored-by: fboulnois <fboulnois@users.noreply.github.com>
  • Loading branch information
otchet-broad and fboulnois authored Feb 19, 2025
1 parent 514264a commit 6311d8c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- run: echo "NODE_VERSION=$(cat Dockerfile | awk 'NR==2 {gsub(":","@",$2); print $2}' | awk '{split($0, array, "@"); print array[2]}')" >> $GITHUB_ENV
- run: echo $NODE_VERSION
- uses: actions/setup-node@v4
with:
node-version: '22.11.0'
node-version: ${{ env.NODE_VERSION }}
- name: install dependencies
run: npm ci
- name: npm audit
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/component-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
- run: echo "NODE_VERSION=$(cat Dockerfile | awk 'NR==2 {gsub(":","@",$2); print $2}' | awk '{split($0, array, "@"); print array[2]}')" >> $GITHUB_ENV
- run: echo $NODE_VERSION
- uses: actions/setup-node@v4
with:
node-version: '22.11.0'
node-version: ${{ env.NODE_VERSION }}
- name: NPM Install
run: npm ci
- name : Cypress run component tests
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ jobs:
uses: actions/checkout@v4
with:
persist-credentials: false
- run: echo "NODE_VERSION=$(cat Dockerfile | awk 'NR==2 {gsub(":","@",$2); print $2}' | awk '{split($0, array, "@"); print array[2]}')" >> $GITHUB_ENV
- run: echo $NODE_VERSION
- uses: actions/setup-node@v4
with:
node-version: '22.11.0'
node-version: ${{ env.NODE_VERSION }}
- name: NPM Install
run: npm ci
- name: Copy Configs
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on: [pull_request]
name: changed files lint
jobs:
scan:
name: npm lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- run: echo "NODE_VERSION=$(cat Dockerfile | awk 'NR==2 {gsub(":","@",$2); print $2}' | awk '{split($0, array, "@"); print array[2]}')" >> $GITHUB_ENV
- run: echo $NODE_VERSION
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: install dependencies
run: npm ci
- name: npm lint
run: npx eslint $(git diff "origin/$DESTINATION_REF" --name-only | xargs)
env:
DESTINATION_REF: ${{ github.event.pull_request.base.ref }}

0 comments on commit 6311d8c

Please sign in to comment.