Skip to content

Commit 0a18718

Browse files
GHA: license check and action pinning
1 parent a747afe commit 0a18718

3 files changed

Lines changed: 83 additions & 3 deletions

File tree

.github/workflows/builds.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ env:
1111
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1212

1313
jobs:
14+
license-check:
15+
name: License Check
16+
uses: ./.github/workflows/license_check.yml
17+
18+
pin-check:
19+
name: Pin Check
20+
uses: ./.github/workflows/pin_check.yml
21+
1422
build:
1523
strategy:
1624
fail-fast: false
@@ -25,10 +33,12 @@ jobs:
2533

2634
name: Build (${{ matrix.name }})
2735
runs-on: ${{ matrix.os }}
36+
permissions:
37+
contents: read
2838

2939
steps:
3040
- name: Checkout
31-
uses: actions/checkout@v4
41+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
3242

3343
# ---------- deps ----------
3444
- name: Install deps (Ubuntu)
@@ -68,7 +78,7 @@ jobs:
6878
6979
- name: Setup MSVC (Windows)
7080
if: runner.os == 'Windows'
71-
uses: ilammy/msvc-dev-cmd@v1
81+
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
7282
with:
7383
arch: x64
7484

@@ -159,7 +169,7 @@ jobs:
159169
160170
# ---------- upload build output ----------
161171
- name: Upload binary
162-
uses: actions/upload-artifact@v4
172+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
163173
with:
164174
name: basic_room-${{ matrix.name }}
165175
path: |
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright 2026 LiveKit, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: License Check
16+
on:
17+
workflow_call: {}
18+
workflow_dispatch: {}
19+
20+
jobs:
21+
license-check:
22+
name: License Check
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
29+
- name: Check License Headers
30+
shell: bash
31+
run: |
32+
shopt -s globstar
33+
# ghcr.io/google/addlicense v1.2.0
34+
docker run --rm -v ${PWD}:/src -w /src ghcr.io/google/addlicense@sha256:5a48f41ccc8cf3fdd04499649f02a9ee5877ab6f39fd1ac18fd1db5eb1062c5a \
35+
-check \
36+
-l apache \
37+
-c "LiveKit, Inc." \
38+
**/*.{cpp,h,hpp}

.github/workflows/pin_check.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2026 LiveKit, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Pin Check
16+
on:
17+
workflow_call: {}
18+
workflow_dispatch:
19+
20+
jobs:
21+
pin-check:
22+
name: Pin Check
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
29+
- name: Pin Check
30+
uses: suzuki-shunsuke/pinact-action@cf51507d80d4d6522a07348e3d58790290eaf0b6 # v2.0.0
31+
with:
32+
skip_push: true

0 commit comments

Comments
 (0)