Skip to content

Commit 91428df

Browse files
committed
ci: bump promci to v0.8.2, add GHCR publishing, harden checkouts
- Drop standalone actions/checkout steps before promci build/publish composite actions (promci v0.8.2 performs checkout internally) - Add persist-credentials: false to the test_go checkout - Bump all promci actions to v0.8.2 (d9d4f5688814f0b77bf003d07fb8c00507390634) - Add packages: write permission to publish_master and publish_release - Add ghcr_io_password: ${{ github.token }} to both publish jobs Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
1 parent 1d7951a commit 91428df

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
image: quay.io/prometheus/golang-builder:1.26-base
2020
steps:
2121
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
persist-credentials: false
2224
- uses: prometheus/promci-setup@5af30ba8c199a91d6c04ebdc3c48e630e355f62d # v0.1.0
2325
- run: make
2426

@@ -37,8 +39,7 @@ jobs:
3739
matrix:
3840
thread: [ 0, 1, 2 ]
3941
steps:
40-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
41-
- uses: prometheus/promci/build@9c86752f3395e08c57719af549cc455d8e2c2514 # v0.7.0
42+
- uses: prometheus/promci/build@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
4243
with:
4344
promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386"
4445
parallelism: 3
@@ -60,8 +61,7 @@ jobs:
6061
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
6162

6263
steps:
63-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
64-
- uses: prometheus/promci/build@9c86752f3395e08c57719af549cc455d8e2c2514 # v0.7.0
64+
- uses: prometheus/promci/build@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
6565
with:
6666
parallelism: 12
6767
thread: ${{ matrix.thread }}
@@ -70,17 +70,19 @@ jobs:
7070
# https://github.com/prometheus/promci/blob/52c7012f5f0070d7281b8db4a119e21341d43c91/actions/publish_main/action.yml
7171
name: Publish master branch artifacts
7272
runs-on: ubuntu-latest
73+
permissions:
74+
packages: write
7375
needs: [test_go, build_all]
7476
if: |
7577
(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
7678
||
7779
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
7880
steps:
79-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
80-
- uses: prometheus/promci/publish_main@9c86752f3395e08c57719af549cc455d8e2c2514 # v0.7.0
81+
- uses: prometheus/promci/publish_main@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
8182
with:
8283
docker_hub_login: ${{ secrets.docker_hub_login }}
8384
docker_hub_password: ${{ secrets.docker_hub_password }}
85+
ghcr_io_password: ${{ github.token }}
8486
quay_io_login: ${{ secrets.quay_io_login }}
8587
quay_io_password: ${{ secrets.quay_io_password }}
8688

@@ -89,15 +91,16 @@ jobs:
8991
runs-on: ubuntu-latest
9092
permissions:
9193
contents: write
94+
packages: write
9295
needs: [test_go, build_all]
9396
if: |
9497
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
9598
steps:
96-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
97-
- uses: prometheus/promci/publish_release@9c86752f3395e08c57719af549cc455d8e2c2514 # v0.7.0
99+
- uses: prometheus/promci/publish_release@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
98100
with:
99101
docker_hub_login: ${{ secrets.docker_hub_login }}
100102
docker_hub_password: ${{ secrets.docker_hub_password }}
103+
ghcr_io_password: ${{ github.token }}
101104
quay_io_login: ${{ secrets.quay_io_login }}
102105
quay_io_password: ${{ secrets.quay_io_password }}
103106
github_token: ${{ github.token }}

0 commit comments

Comments
 (0)