@@ -35,12 +35,12 @@ jobs:
3535 run : echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
3636
3737 - name : Git Checkout
38- uses : actions/checkout@v3
38+ uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
3939 with :
4040 fetch-depth : 2
4141
4242 - name : Restore Cache
43- uses : actions/cache/restore@v3
43+ uses : actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
4444 with :
4545 path : |
4646 ~/.npm
5050 restore-keys : cache-
5151
5252 - name : Set up Node.js
53- uses : actions/setup-node@v3
53+ uses : actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8
5454 with :
5555 node-version-file : ' .nvmrc'
5656 cache : ' npm'
@@ -70,13 +70,13 @@ jobs:
7070 run : npx -p nextjs-bundle-analysis report
7171
7272 - name : Upload Build Analysis
73- uses : actions/upload-artifact@v3
73+ uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
7474 with :
7575 name : bundle-analysis
7676 path : .next/analyze/__bundle_analysis.json
7777
7878 - name : Save Cache
79- uses : actions/cache/save@v3
79+ uses : actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
8080 with :
8181 path : |
8282 ~/.npm
@@ -91,10 +91,10 @@ jobs:
9191
9292 steps :
9393 - name : Git Checkout
94- uses : actions/checkout@v3
94+ uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
9595
9696 - name : Restore Cache
97- uses : actions/cache/restore@v3
97+ uses : actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
9898 with :
9999 path : |
100100 ~/.npm
@@ -104,25 +104,32 @@ jobs:
104104 restore-keys : cache-
105105
106106 - name : Download PR Bundle Analysis
107- uses : actions/download-artifact@v3
107+ uses : actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
108108 with :
109109 name : bundle-analysis
110110 path : .next/analyze
111111
112- - name : Copy PR Bundle Analysis (Fallback)
113- run : |
114- mkdir -p .next/analyze/base/bundle/
115- cp .next/analyze/__bundle_analysis.json .next/analyze/base/bundle/__bundle_analysis.json
116-
117112 - name : Download Base Bundle Analysis
118- uses : dawidd6/action-download-artifact@v2
113+ uses : dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615
119114 if : success() && github.event.number
120115 with :
121116 name : bundle-analysis
122117 branch : ${{ github.event.pull_request.base.ref }}
123118 path : .next/analyze/base/bundle
124119 if_no_artifact_found : warn
125120
121+ - name : Check Base Bundle Analysis File
122+ id : check-base-bundle-analysis-file
123+ uses : andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b
124+ with :
125+ files : .next/analyze/base/bundle/__bundle_analysis.json
126+
127+ - name : Copy PR Bundle Analysis (Fallback)
128+ if : steps.check-base-bundle-analysis-file.outputs.files_exists == 'true'
129+ run : |
130+ mkdir -p .next/analyze/base/bundle/
131+ cp .next/analyze/__bundle_analysis.json .next/analyze/base/bundle/__bundle_analysis.json
132+
126133 - name : Compare with base branch bundle
127134 if : success() && github.event.number
128135 run : ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
@@ -136,22 +143,22 @@ jobs:
136143 echo EOF >> $GITHUB_OUTPUT
137144
138145 - name : Find Comment
139- uses : peter-evans/find-comment@v2
146+ uses : peter-evans/find-comment@a54c31d7fa095754bfef525c0c8e5e5674c4b4b1
140147 if : success() && github.event.number
141148 id : find-comment-id
142149 with :
143150 issue-number : ${{ github.event.number }}
144151 body-includes : ' <!-- __NEXTJS_BUNDLE_nodejs.org -->'
145152
146153 - name : Create Comment
147- uses : peter-evans/create-or-update-comment@v2
154+ uses : peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa
148155 if : success() && github.event.number && steps.find-comment-id.outputs.comment-id == 0
149156 with :
150157 issue-number : ${{ github.event.number }}
151158 body : ${{ steps.get-comment-body.outputs.body }}
152159
153160 - name : Update Comment
154- uses : peter-evans/create-or-update-comment@v2
161+ uses : peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa
155162 if : success() && github.event.number && steps.find-comment-id.outputs.comment-id != 0
156163 with :
157164 issue-number : ${{ github.event.number }}
0 commit comments