Skip to content

Commit 347144d

Browse files
committed
Move git update index command from GitHub Actions yaml to project.clj
1 parent b4f39c9 commit 347144d

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,7 @@ jobs:
3434
key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
3535
restore-keys: |
3636
${{ runner.os }}-shadow-cljs-
37-
# The git update-index command is required to ignore changes to package.json as
38-
# 1. package.json must be committed 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 committed
41-
# 3. git recognising package.json modifications would cause day8/lein-git-inject to always incorrectly use
42-
# -SNAPSHOT versions.
4337
- run: |
44-
git update-index --assume-unchanged package.json
4538
lein karma-once
4639
- name: Slack notification
4740
uses: homoluctus/slatify@v2.0.1
@@ -69,15 +62,8 @@ jobs:
6962
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
7063
restore-keys: |
7164
${{ runner.os }}-maven-
72-
# The git update-index command is required to ignore changes to package.json as
73-
# 1. package.json must be committed 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 committed
76-
# 3. git recognising package.json modifications would cause day8/lein-git-inject to always incorrectly use
77-
# -SNAPSHOT versions.
7865
- name: Run lein release
7966
run: |
80-
git update-index --assume-unchanged package.json
8167
CLOJARS_USERNAME=${{ secrets.CLOJARS_USERNAME }} CLOJARS_TOKEN=${{ secrets.CLOJARS_TOKEN }} GITHUB_USERNAME=${{ github.actor }} GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} lein release
8268
# This creates a 'GitHub Release' from the tag and includes link to the CHANGELOG
8369
# at that point in the Git history. We do not use draft or prerelease features as

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,7 @@ jobs:
3131
key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
3232
restore-keys: |
3333
${{ runner.os }}-shadow-cljs-
34-
# The git update-index command is required to ignore changes to package.json as
35-
# 1. package.json must be committed 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 committed
38-
# 3. git recognising package.json modifications would cause day8/lein-git-inject to always incorrectly use
39-
# -SNAPSHOT versions.
4034
- run: |
41-
git update-index --assume-unchanged package.json
4235
lein karma-once
4336
- name: Slack notification
4437
uses: homoluctus/slatify@v2.0.1

project.clj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,18 @@
5151
:output-to "target/karma-test.js"
5252
:compiler-options {:pretty-print true}}}}
5353

54+
;; The git update-index command is required to ignore changes to package.json as
55+
;; 1. package.json must be committed to the repo for npm install --save... to behave correctly, which is used by
56+
;; lein-shadow to install dependencies that would cause the build to fail if missing; e.g. karma
57+
;; 2. .gitignore does nothing for files that are already committed
58+
;; 3. git recognising package.json modifications would cause day8/lein-git-inject to always incorrectly use
59+
;; -SNAPSHOT versions.
5460
:aliases {"test-auto" ["do"
5561
["clean"]
62+
["shell" "git" "update-index" "--assume-unchanged" "package.json"]
5663
["shadow" "watch" "browser-test"]]
5764
"karma-once" ["do"
5865
["clean"]
66+
["shell" "git" "update-index" "--assume-unchanged" "package.json"]
5967
["shadow" "compile" "karma-test"]
6068
["shell" "karma" "start" "--single-run" "--reporters" "junit,dots"]]})

0 commit comments

Comments
 (0)