Skip to content

Commit 633965f

Browse files
authored
ci: apply github workflow best practice (zizmor/codeql/asf-allowlist-check) (#618)
Adding these 3 checks for all apache/iceberg* repos as part of apache/iceberg#15742
1 parent c38b392 commit 633965f

File tree

11 files changed

+179
-36
lines changed

11 files changed

+179
-36
lines changed

.github/dependabot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
19+
version: 2
20+
updates:
21+
# Maintain dependencies for GitHub Actions
22+
- package-ecosystem: "github-actions"
23+
directory: "/"
24+
schedule:
25+
interval: "weekly"
26+
day: "sunday"
27+
cooldown:
28+
default-days: 7
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
# Verifies all GitHub Actions refs are on the ASF allowlist.
21+
# Actions not on the allowlist silently fail with "Startup failure" — no logs,
22+
# no notifications, and PRs may appear green because no checks ran.
23+
# See https://github.com/apache/infrastructure-actions/issues/574
24+
name: "ASF Allowlist Check"
25+
26+
on:
27+
pull_request:
28+
paths:
29+
- ".github/**"
30+
push:
31+
branches:
32+
- main
33+
paths:
34+
- ".github/**"
35+
36+
permissions:
37+
contents: read
38+
39+
jobs:
40+
asf-allowlist-check:
41+
runs-on: ubuntu-24.04
42+
steps:
43+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
44+
with:
45+
persist-credentials: false
46+
- uses: apache/infrastructure-actions/allowlist-check@4e9c961f587f72b170874b6f5cd4ac15f7f26eb8 # main

.github/workflows/codeql.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ name: "CodeQL"
2121

2222
on:
2323
push:
24-
branches:
25-
- main
24+
branches: [ "main" ]
2625
pull_request:
27-
branches:
28-
- main
26+
branches: [ "main" ]
2927
schedule:
3028
- cron: '16 4 * * 1'
3129

@@ -43,14 +41,16 @@ jobs:
4341

4442
steps:
4543
- name: Checkout repository
46-
uses: actions/checkout@v6
44+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
45+
with:
46+
persist-credentials: false
4747

4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@v4
49+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
5050
with:
5151
languages: actions
5252

5353
- name: Perform CodeQL Analysis
54-
uses: github/codeql-action/analyze@v4
54+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
5555
with:
5656
category: "/language:actions"

.github/workflows/cpp-linter.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
pull-requests: write
3535
steps:
3636
- name: Checkout iceberg-cpp
37-
uses: actions/checkout@v6
37+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
38+
with:
39+
persist-credentials: false
3840
- name: Install dependencies
3941
shell: bash
4042
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
@@ -46,7 +48,7 @@ jobs:
4648
mkdir build && cd build
4749
cmake .. -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
4850
cmake --build .
49-
- uses: cpp-linter/cpp-linter-action@0f6d1b8d7e38b584cbee606eb23d850c217d54f8
51+
- uses: cpp-linter/cpp-linter-action@0f6d1b8d7e38b584cbee606eb23d850c217d54f8 # v2.15.1
5052
id: linter
5153
continue-on-error: true
5254
env:
@@ -66,5 +68,7 @@ jobs:
6668
- name: Fail fast?!
6769
if: steps.linter.outputs.checks-failed != 0
6870
run: |
69-
echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}"
71+
echo "some linter checks failed. ${STEPS_LINTER_OUTPUTS_CHECKS_FAILED}"
7072
exit 1
73+
env:
74+
STEPS_LINTER_OUTPUTS_CHECKS_FAILED: ${{ steps.linter.outputs.checks-failed }}

.github/workflows/docs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ jobs:
3737
runs-on: ubuntu-slim
3838

3939
steps:
40-
- uses: actions/checkout@v6
40+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
4141
with:
4242
fetch-depth: 1
43+
persist-credentials: false
4344

44-
- uses: actions/setup-python@v6
45+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
4546
with:
4647
python-version: '3.x'
4748

.github/workflows/license_check.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ jobs:
2828
runs-on: ubuntu-slim
2929
steps:
3030
- name: Checkout repository
31-
uses: actions/checkout@v6
31+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
32+
with:
33+
persist-credentials: false
3234
- name: Check license header
33-
uses: apache/skywalking-eyes@main
35+
uses: apache/skywalking-eyes@61275cc80d0798a405cb070f7d3a8aaf7cf2c2c1 # v0.8.0
3436
env:
3537
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3638
with:

.github/workflows/pre-commit.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
pre-commit:
3232
runs-on: ubuntu-slim
3333
steps:
34-
- uses: actions/checkout@v6
35-
- uses: actions/setup-python@v6
34+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
35+
with:
36+
persist-credentials: false
37+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
3638
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

.github/workflows/rc.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
timeout-minutes: 5
3535
steps:
3636
- name: Checkout
37-
uses: actions/checkout@v6
37+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
38+
with:
39+
persist-credentials: false
3840

3941
- name: Prepare for tag
4042
if: github.ref_type == 'tag'
@@ -84,9 +86,11 @@ jobs:
8486
CXX: g++-14
8587
steps:
8688
- name: Checkout
87-
uses: actions/checkout@v6
89+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
90+
with:
91+
persist-credentials: false
8892

89-
- uses: actions/download-artifact@v8
93+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
9094
with:
9195
name: archive
9296

@@ -130,9 +134,11 @@ jobs:
130134
contents: write
131135
steps:
132136
- name: Checkout
133-
uses: actions/checkout@v6
137+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
138+
with:
139+
persist-credentials: false
134140

135-
- uses: actions/download-artifact@v8
141+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
136142
with:
137143
name: archive
138144

.github/workflows/sanitizer_test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ jobs:
3939
runs-on: ubuntu-24.04
4040
steps:
4141
- name: Checkout iceberg-cpp
42-
uses: actions/checkout@v6
42+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
43+
with:
44+
persist-credentials: false
4345
- name: Install dependencies
4446
shell: bash
4547
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev

.github/workflows/test.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ jobs:
5252
AWS_EC2_METADATA_DISABLED: "TRUE"
5353
steps:
5454
- name: Checkout iceberg-cpp
55-
uses: actions/checkout@v6
55+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
56+
with:
57+
persist-credentials: false
5658
- name: Install dependencies
5759
shell: bash
5860
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
@@ -86,7 +88,9 @@ jobs:
8688
AWS_EC2_METADATA_DISABLED: "TRUE"
8789
steps:
8890
- name: Checkout iceberg-cpp
89-
uses: actions/checkout@v6
91+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
92+
with:
93+
persist-credentials: false
9094
- name: Start MinIO
9195
shell: bash
9296
run: bash ci/scripts/start_minio.sh
@@ -111,30 +115,32 @@ jobs:
111115
AWS_EC2_METADATA_DISABLED: "TRUE"
112116
steps:
113117
- name: Checkout iceberg-cpp
114-
uses: actions/checkout@v6
118+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
119+
with:
120+
persist-credentials: false
115121
- name: Install dependencies
116-
shell: cmd
122+
shell: pwsh
117123
run: |
118124
vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows
119125
- name: Setup sccache
120-
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
126+
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 # zizmor: ignore[cache-poisoning] -- only used for build caching, no artifacts published
121127
- name: Start MinIO
122128
shell: bash
123129
run: bash ci/scripts/start_minio.sh
124130
- name: Build Iceberg
125-
shell: cmd
131+
shell: pwsh
126132
env:
127133
SCCACHE_GHA_ENABLED: "true"
128134
run: |
129-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
130-
bash -c "ci/scripts/build_iceberg.sh $(pwd) OFF ON"
131-
if %errorlevel% neq 0 exit /b %errorlevel%
135+
$ErrorActionPreference = "Stop"
136+
cmd /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat`" x64 && bash -lc `"ci/scripts/build_iceberg.sh `$(pwd) OFF ON`""
137+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
132138
sccache --show-stats
133139
- name: Build Example
134-
shell: cmd
140+
shell: pwsh
135141
run: |
136-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
137-
bash -c "ci/scripts/build_example.sh $(pwd)/example"
142+
$ErrorActionPreference = "Stop"
143+
cmd /c "call `"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat`" x64 && bash -lc `"ci/scripts/build_example.sh `$(pwd)/example`""
138144
meson:
139145
name: Meson - ${{ matrix.title }}
140146
runs-on: ${{ matrix.runs-on }}
@@ -155,11 +161,13 @@ jobs:
155161
- title: AArch64 macOS 26
156162
runs-on: macos-26
157163
steps:
158-
- uses: actions/setup-python@v6
164+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
159165
with:
160166
python-version: '3.x'
161167
- name: Checkout iceberg-cpp
162-
uses: actions/checkout@v6
168+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
169+
with:
170+
persist-credentials: false
163171
- name: Install build dependencies
164172
run: |
165173
python3 -m pip install --upgrade pip

0 commit comments

Comments
 (0)