Skip to content

Commit b718067

Browse files
committed
ci: push to GHCR, harden checkouts, bump promci to v0.8.2
- Add ghcr_io_password: github.token to publish_main and publish_release - Add packages: write permission to publish_main and publish_release - Drop redundant actions/checkout before promci build/publish steps - Add persist-credentials: false to the test_go checkout - Bump promci composite actions from v0.7.0 to v0.8.2 Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
1 parent 502d535 commit b718067

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 6 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 GO_ONLY=1 SKIP_GOLANGCI_LINT=1
2426

@@ -29,26 +31,27 @@ jobs:
2931
matrix:
3032
thread: [ 0, 1, 2, 3]
3133
steps:
32-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
33-
- uses: prometheus/promci/build@9c86752f3395e08c57719af549cc455d8e2c2514 # v0.7.0
34+
- uses: prometheus/promci/build@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
3435
with:
3536
parallelism: 4
3637
thread: ${{ matrix.thread }}
3738

3839
publish_main:
3940
name: Publish main branch artifacts
4041
runs-on: ubuntu-latest
42+
permissions:
43+
packages: write
4144
needs: [test_go, build]
4245
if: |
4346
(github.event_name == 'push' && github.event.ref == 'refs/heads/main')
4447
||
4548
(github.event_name == 'push' && github.event.ref == 'refs/heads/master')
4649
steps:
47-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
48-
- uses: prometheus/promci/publish_main@9c86752f3395e08c57719af549cc455d8e2c2514 # v0.7.0
50+
- uses: prometheus/promci/publish_main@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
4951
with:
5052
docker_hub_organization: prometheuscommunity
5153
docker_hub_password: ${{ secrets.docker_hub_password }}
54+
ghcr_io_password: ${{ github.token }}
5255
quay_io_organization: prometheuscommunity
5356
quay_io_password: ${{ secrets.quay_io_password }}
5457

@@ -57,15 +60,16 @@ jobs:
5760
runs-on: ubuntu-latest
5861
permissions:
5962
contents: write
63+
packages: write
6064
needs: [test_go, build]
6165
if: |
6266
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
6367
steps:
64-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
65-
- uses: prometheus/promci/publish_release@9c86752f3395e08c57719af549cc455d8e2c2514 # v0.7.0
68+
- uses: prometheus/promci/publish_release@d9d4f5688814f0b77bf003d07fb8c00507390634 # v0.8.2
6669
with:
6770
docker_hub_organization: prometheuscommunity
6871
docker_hub_password: ${{ secrets.docker_hub_password }}
72+
ghcr_io_password: ${{ github.token }}
6973
quay_io_organization: prometheuscommunity
7074
quay_io_password: ${{ secrets.quay_io_password }}
7175
github_token: ${{ github.token }}

0 commit comments

Comments
 (0)