Skip to content

Commit

Permalink
add env variable COMMITS_TO_FETCH to remove magic number 3
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-piotrowicz committed Mar 5, 2024
1 parent 9b55ed7 commit a39294b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/c3-e2e-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
env:
node-version: 18.17.1
bun-version: 1.0.3
# we need to fetch 3 commits because dependabot generates one, our changeset
# generation workflow generates another and we need the parent of both commits
# so that we can diff it (`git diff HEAD~n`) and see what package changed in
# the `package.json` file
COMMITS_TO_FETCH: 3

jobs:
get-dependabot-bumped-framework:
Expand All @@ -23,7 +28,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 3
fetch-depth: ${{ env.COMMITS_TO_FETCH }}

- name: detect-bumped-framework
id: detect
Expand Down Expand Up @@ -55,7 +60,7 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 3
fetch-depth: ${{ env.COMMITS_TO_FETCH }}

- name: Install Dependencies
uses: ./.github/actions/install-dependencies
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/c3-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
env:
node-version: 18.17.1
bun-version: 1.0.3
# we need to fetch 3 commits because dependabot generates one, our changeset
# generation workflow generates another and we need the parent of both commits
# so that we can diff it (`git diff HEAD~n`) and see what package changed in
# the `package.json` file
COMMITS_TO_FETCH: 3

jobs:
e2e:
# Note: please keep this job in sync with the e2e-only-dependabot-bumped-framework one
Expand All @@ -32,7 +38,7 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 3
fetch-depth: ${{ env.COMMITS_TO_FETCH }}

- name: Install Dependencies
uses: ./.github/actions/install-dependencies
Expand Down

0 comments on commit a39294b

Please sign in to comment.