Skip to content

Commit

Permalink
Use git fetch to fetch the base commit instead of all history for lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
goodov committed Jul 24, 2024
1 parent e14aa77 commit 4af9d43
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/generate-test-seed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ jobs:
runs-on: ubuntu-latest
env:
ACTION_RUN_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
BASE_SHA: '${{ github.event.pull_request.base.sha }}'
REMOTE_SEED_PATH: 'pull/${{ github.event.pull_request.number }}/seed'
SEED_VERSION: 'pull/${{ github.event.pull_request.number }}@${{ github.event.pull_request.head.sha }}'

steps:
- name: checkout

Check failure on line 19 in .github/workflows/generate-test-seed.yml

View workflow job for this annotation

GitHub Actions / build

step must run script with "run" section or run action with "uses" section
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0

- name: fetch base commit
run: git fetch --depth=1 origin ${BASE_SHA}

Check failure on line 23 in .github/workflows/generate-test-seed.yml

View workflow job for this annotation

GitHub Actions / build

shellcheck reported issue in this script: SC2086:info:1:28: Double quote to prevent globbing and word splitting

- name: Setup Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
Expand Down Expand Up @@ -59,7 +62,7 @@ jobs:
- name: Lint
run: |

Check failure on line 64 in .github/workflows/generate-test-seed.yml

View workflow job for this annotation

GitHub Actions / build

shellcheck reported issue in this script: SC2086:info:1:24: Double quote to prevent globbing and word splitting
npm run lint -- --base origin/${{ github.event.pull_request.base.ref }}
npm run lint -- --base ${BASE_SHA}
- name: Generate seed
run: |
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/test-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
BASE_SHA: '${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}'

steps:
- name: checkout

Check failure on line 14 in .github/workflows/test-src.yml

View workflow job for this annotation

GitHub Actions / build

step must run script with "run" section or run action with "uses" section
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0

- name: fetch base commit
run: git fetch --depth=1 origin ${BASE_SHA}

Check failure on line 18 in .github/workflows/test-src.yml

View workflow job for this annotation

GitHub Actions / build

shellcheck reported issue in this script: SC2086:info:1:28: Double quote to prevent globbing and word splitting

- name: npm install
run: npm install
Expand All @@ -25,4 +30,4 @@ jobs:
run: npm run test

- name: lint
run: npm run lint -- --base ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
run: npm run lint -- --base ${BASE_SHA}

Check failure on line 33 in .github/workflows/test-src.yml

View workflow job for this annotation

GitHub Actions / build

shellcheck reported issue in this script: SC2086:info:1:24: Double quote to prevent globbing and word splitting

0 comments on commit 4af9d43

Please sign in to comment.