Skip to content

Commit a5cfacc

Browse files
committed
Ignore changes to package.json in GitHub Actions
1 parent 809e33f commit a5cfacc

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

.github/workflows/continuous-deployment-workflow.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@ jobs:
3434
key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
3535
restore-keys: |
3636
${{ runner.os }}-shadow-cljs-
37-
- run: lein karma-once
37+
# The git update-index command is required to ignore changes to package.json as
38+
# 1. package.json must be comitted to the repo for npm install --save... to behave correctly, which is used by
39+
# lein-shadow to install dependencies that would cause the build to fail if missing; e.g. karma
40+
# 2. .gitignore does nothing for files that are already comitted
41+
# 3. git recognising package.json modifications would cause day8/lein-git-inject to always incorrectly use
42+
# -SNAPSHOT versions.
43+
- run: |
44+
git update-index --assume-unchanged package.json
45+
lein karma-once
3846
- name: Slack notification
3947
uses: homoluctus/slatify@v2.0.1
4048
if: failure() || cancelled()
@@ -61,8 +69,15 @@ jobs:
6169
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
6270
restore-keys: |
6371
${{ runner.os }}-maven-
72+
# The git update-index command is required to ignore changes to package.json as
73+
# 1. package.json must be comitted to the repo for npm install --save... to behave correctly, which is used by
74+
# lein-shadow to install dependencies that would cause the build to fail if missing; e.g. karma
75+
# 2. .gitignore does nothing for files that are already comitted
76+
# 3. git recognising package.json modifications would cause day8/lein-git-inject to always incorrectly use
77+
# -SNAPSHOT versions.
6478
- name: Run lein release
6579
run: |
80+
git update-index --assume-unchanged package.json
6681
CLOJARS_USERNAME=${{ secrets.CLOJARS_USERNAME }} CLOJARS_TOKEN=${{ secrets.CLOJARS_TOKEN }} GITHUB_USERNAME=${{ github.actor }} GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} lein release
6782
# This creates a 'GitHub Release' from the tag and includes link to the CHANGELOG
6883
# at that point in the Git history. We do not use draft or prerelease features as

.github/workflows/continuous-integration-workflow.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@ jobs:
3131
key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
3232
restore-keys: |
3333
${{ runner.os }}-shadow-cljs-
34-
- run: lein karma-once
34+
# The git update-index command is required to ignore changes to package.json as
35+
# 1. package.json must be comitted to the repo for npm install --save... to behave correctly, which is used by
36+
# lein-shadow to install dependencies that would cause the build to fail if missing; e.g. karma
37+
# 2. .gitignore does nothing for files that are already comitted
38+
# 3. git recognising package.json modifications would cause day8/lein-git-inject to always incorrectly use
39+
# -SNAPSHOT versions.
40+
- run: |
41+
git update-index --assume-unchanged package.json
42+
lein karma-once
3543
- name: Slack notification
3644
uses: homoluctus/slatify@v2.0.1
3745
if: failure() || cancelled()

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ misc/
1919
node_modules/
2020
.shadow-cljs
2121
shadow-cljs.edn
22-
package.json
2322
package-lock.json

0 commit comments

Comments
 (0)