Skip to content

Commit fe52c7f

Browse files
committed
[#2097] Use SHA instead of versions in GH actions
1 parent 5a4afb4 commit fe52c7f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

.github/workflows/build.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
- 5432:5432
8282
steps:
8383
- name: Checkout ${{ inputs.branch }}
84-
uses: actions/checkout@v2
84+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8585
with:
8686
ref: ${{ inputs.branch }}
8787
- name: Get year/month for cache key
@@ -90,7 +90,7 @@ jobs:
9090
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
9191
shell: bash
9292
- name: Cache Gradle downloads
93-
uses: actions/cache@v4
93+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
9494
id: cache-gradle
9595
with:
9696
path: |
@@ -100,7 +100,7 @@ jobs:
100100
# refresh cache every month to avoid unlimited growth
101101
key: gradle-examples-${{ matrix.db }}-${{ steps.get-date.outputs.yearmonth }}
102102
- name: Set up JDK 11
103-
uses: actions/setup-java@v2.2.0
103+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
104104
with:
105105
distribution: 'temurin'
106106
java-version: 11
@@ -109,7 +109,7 @@ jobs:
109109
- name: Run examples in '${{ matrix.example }}' on ${{ matrix.db }}
110110
run: ./gradlew :${{ matrix.example }}:runAllExamplesOn${{ matrix.db }}
111111
- name: Upload reports (if build failed)
112-
uses: actions/upload-artifact@v4
112+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
113113
if: failure()
114114
with:
115115
name: reports-examples-${{ matrix.db }}
@@ -123,7 +123,7 @@ jobs:
123123
db: [ 'MariaDB', 'MySQL', 'PostgreSQL', 'MSSQLServer', 'CockroachDB', 'Db2', 'Oracle' ]
124124
steps:
125125
- name: Checkout ${{ inputs.branch }}
126-
uses: actions/checkout@v2
126+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
127127
with:
128128
ref: ${{ inputs.branch }}
129129
- name: Get year/month for cache key
@@ -132,7 +132,7 @@ jobs:
132132
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
133133
shell: bash
134134
- name: Cache Gradle downloads
135-
uses: actions/cache@v4
135+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
136136
id: cache-gradle
137137
with:
138138
path: |
@@ -142,7 +142,7 @@ jobs:
142142
# refresh cache every month to avoid unlimited growth
143143
key: gradle-db-${{ matrix.db }}-${{ steps.get-date.outputs.yearmonth }}
144144
- name: Set up JDK 11
145-
uses: actions/setup-java@v2.2.0
145+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
146146
with:
147147
distribution: 'temurin'
148148
java-version: 11
@@ -151,7 +151,7 @@ jobs:
151151
- name: Build and Test with ${{ matrix.db }}
152152
run: ./gradlew build -PshowStandardOutput -Pdocker -Pdb=${{ matrix.db }}
153153
- name: Upload reports (if build failed)
154-
uses: actions/upload-artifact@v4
154+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
155155
if: failure()
156156
with:
157157
name: reports-db-${{ matrix.db }}
@@ -182,7 +182,7 @@ jobs:
182182
- { name: "25-ea", java_version_numeric: 25, from: 'jdk.java.net', jvm_args: '--enable-preview' }
183183
steps:
184184
- name: Checkout ${{ inputs.branch }}
185-
uses: actions/checkout@v2
185+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
186186
with:
187187
ref: ${{ inputs.branch }}
188188
- name: Get year/month for cache key
@@ -203,7 +203,7 @@ jobs:
203203
echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
204204
- name: Cache Maven/Gradle Dependency/Dist Caches
205205
id: cache-maven
206-
uses: actions/cache@v4
206+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
207207
# if it's not a pull request, we restore and save the cache
208208
if: github.event_name != 'pull_request'
209209
with:
@@ -220,7 +220,7 @@ jobs:
220220
${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}-
221221
${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}-
222222
- name: Restore Maven/Gradle Dependency/Dist Caches
223-
uses: actions/cache/restore@v4
223+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
224224
# if it's a pull request, we restore the cache, but we don't save it
225225
if: github.event_name == 'pull_request'
226226
with:
@@ -236,13 +236,13 @@ jobs:
236236
237237
- name: Set up latest JDK ${{ matrix.java.name }} from jdk.java.net
238238
if: matrix.java.from == 'jdk.java.net'
239-
uses: oracle-actions/setup-java@v1
239+
uses: oracle-actions/setup-java@2e744f723b003fdd759727d0ff654c8717024845 # v1.4.0
240240
with:
241241
website: jdk.java.net
242242
release: ${{ matrix.java.java_version_numeric }}
243243
- name: Set up latest JDK ${{ matrix.java.name }} from Adoptium
244244
if: matrix.java.from == '' || matrix.java.from == 'adoptium.net'
245-
uses: actions/setup-java@v2.2.0
245+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
246246
with:
247247
distribution: 'temurin'
248248
java-version: ${{ matrix.java.java_version_numeric }}
@@ -252,7 +252,7 @@ jobs:
252252
run: echo "::set-output name=path::${JAVA_HOME}"
253253
# Always use JDK 11 to build the main code: that's what we use for releases.
254254
- name: Set up JDK 11
255-
uses: actions/setup-java@v2.2.0
255+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
256256
with:
257257
distribution: 'temurin'
258258
java-version: 11
@@ -271,7 +271,7 @@ jobs:
271271
-Porg.gradle.java.installations.paths=${{ steps.mainjdk-exportpath.outputs.path }},${{ steps.testjdk-exportpath.outputs.path }} \
272272
${{ matrix.java.jvm_args && '-Ptest.jdk.launcher.args=' }}${{ matrix.java.jvm_args }}
273273
- name: Upload reports (if build failed)
274-
uses: actions/upload-artifact@v4
274+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
275275
if: failure()
276276
with:
277277
name: reports-java${{ matrix.java.name }}

0 commit comments

Comments
 (0)