Skip to content

Commit 2c16f44

Browse files
authored
ci: improve security of all GitHub Actions (#273)
1 parent 7228aad commit 2c16f44

23 files changed

+116
-0
lines changed

.github/workflows/adbe-installtests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ concurrency:
2525
group: ${{ github.workflow }}-${{ github.ref }}
2626
cancel-in-progress: true
2727

28+
permissions:
29+
contents: read
30+
2831
jobs:
2932
testOnAndroidDevice:
3033
runs-on: ubuntu-latest
@@ -37,6 +40,8 @@ jobs:
3740
steps:
3841
- name: checkout
3942
uses: actions/checkout@v4
43+
with:
44+
persist-credentials: false
4045

4146
# Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
4247
- name: Enable KVM

.github/workflows/adbe-unittests-api16.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ concurrency:
2525
group: ${{ github.workflow }}-${{ github.ref }}
2626
cancel-in-progress: true
2727

28+
permissions:
29+
contents: read
30+
2831
jobs:
2932
testOnAndroidApi16:
3033
runs-on: ubuntu-latest
@@ -40,6 +43,8 @@ jobs:
4043
steps:
4144
- name: checkout
4245
uses: actions/checkout@v4
46+
with:
47+
persist-credentials: false
4348

4449
# Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
4550
- name: Enable KVM

.github/workflows/adbe-unittests-api21.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
test:
1821
runs-on: ubuntu-latest
@@ -26,6 +29,8 @@ jobs:
2629
steps:
2730
- name: checkout
2831
uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
2934

3035
# Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
3136
- name: Enable KVM

.github/workflows/adbe-unittests-api22.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
testOnApi22:
1821
runs-on: ubuntu-latest
@@ -26,6 +29,8 @@ jobs:
2629
steps:
2730
- name: checkout
2831
uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
2934

3035
# Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
3136
- name: Enable KVM

.github/workflows/adbe-unittests-api23.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: read
18+
19+
1620
jobs:
1721
testOnAp23:
1822
runs-on: ubuntu-latest
@@ -26,6 +30,8 @@ jobs:
2630
steps:
2731
- name: checkout
2832
uses: actions/checkout@v4
33+
with:
34+
persist-credentials: false
2935

3036
# Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
3137
- name: Enable KVM

.github/workflows/adbe-unittests-api24.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
testOnApi24:
1821
runs-on: ubuntu-latest
@@ -26,6 +29,8 @@ jobs:
2629
steps:
2730
- name: checkout
2831
uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
2934

3035
- name: Gradle cache
3136
uses: gradle/actions/setup-gradle@v4

.github/workflows/adbe-unittests-api25.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
testOnApi25:
1821
runs-on: ubuntu-latest
@@ -26,6 +29,8 @@ jobs:
2629
steps:
2730
- name: checkout
2831
uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
2934

3035
# Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
3136
- name: Enable KVM

.github/workflows/adbe-unittests-api26.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
testOnApi26:
1821
# This hangs on ubuntu-latest
@@ -29,6 +32,8 @@ jobs:
2932
steps:
3033
- name: checkout
3134
uses: actions/checkout@v4
35+
with:
36+
persist-credentials: false
3237

3338
# Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
3439
- name: Enable KVM

.github/workflows/adbe-unittests-api27.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
testOnApi27:
1821
runs-on: ubuntu-latest
@@ -26,6 +29,8 @@ jobs:
2629
steps:
2730
- name: checkout
2831
uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
2934

3035
# Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
3136
- name: Enable KVM

.github/workflows/adbe-unittests-api28.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
testOnApi28:
1821
runs-on: ubuntu-latest
@@ -26,6 +29,8 @@ jobs:
2629
steps:
2730
- name: checkout
2831
uses: actions/checkout@v4
32+
with:
33+
persist-credentials: false
2934

3035
# Ref: https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#running-hardware-accelerated-emulators-on-linux-runners
3136
- name: Enable KVM

0 commit comments

Comments
 (0)