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 16e9d02 commit da7a9f2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/generate-test-seed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ 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:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0

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

- name: Setup Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
Expand Down Expand Up @@ -59,7 +61,7 @@ jobs:
- name: Lint
run: |
npm run lint -- --base ${{ github.event.pull_request.base.sha }}
npm run lint -- --base "$BASE_SHA"
- name: Generate seed
run: |
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/test-src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
BASE_SHA: '${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}'

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0

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

- name: npm install
run: npm install
Expand All @@ -25,4 +29,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"
2 changes: 1 addition & 1 deletion seed/seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"ANDROID"
]
},
"name": "Default1pBlockingStudy"
"name": "Default1pBlockingStudyy"
},
{
"experiments": [
Expand Down

0 comments on commit da7a9f2

Please sign in to comment.