fix(ci): move ACT guards to step level; add guards to security.yml

env context is invalid in job-level if conditions — moved all ACT
guards down to individual steps. Also guards docker login + scout
in security.yml so act can run the build-only part of that workflow.
This commit is contained in:
jubnl
2026-05-25 21:10:36 +02:00
parent 797183de08
commit f92b95e054
3 changed files with 18 additions and 3 deletions
+8 -1
View File
@@ -120,17 +120,18 @@ jobs:
retention-days: 1 retention-days: 1
merge: merge:
if: ${{ !env.ACT }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [version-bump, build] needs: [version-bump, build]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
if: ${{ !env.ACT }}
with: with:
ref: ${{ needs.version-bump.outputs.sha }} ref: ${{ needs.version-bump.outputs.sha }}
fetch-depth: 0 fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- name: Download build digests - name: Download build digests
if: ${{ !env.ACT }}
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
path: /tmp/digests path: /tmp/digests
@@ -138,13 +139,16 @@ jobs:
merge-multiple: true merge-multiple: true
- uses: docker/setup-buildx-action@v3 - uses: docker/setup-buildx-action@v3
if: ${{ !env.ACT }}
- uses: docker/login-action@v3 - uses: docker/login-action@v3
if: ${{ !env.ACT }}
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create and push multi-arch manifest - name: Create and push multi-arch manifest
if: ${{ !env.ACT }}
working-directory: /tmp/digests working-directory: /tmp/digests
run: | run: |
VERSION="${{ needs.version-bump.outputs.version }}" VERSION="${{ needs.version-bump.outputs.version }}"
@@ -157,9 +161,11 @@ jobs:
"${digests[@]}" "${digests[@]}"
- name: Inspect manifest - name: Inspect manifest
if: ${{ !env.ACT }}
run: docker buildx imagetools inspect mauriceboe/trek:latest-pre run: docker buildx imagetools inspect mauriceboe/trek:latest-pre
- name: Push git tag - name: Push git tag
if: ${{ !env.ACT }}
run: | run: |
VERSION="${{ needs.version-bump.outputs.version }}" VERSION="${{ needs.version-bump.outputs.version }}"
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
@@ -168,6 +174,7 @@ jobs:
git push origin "v$VERSION" git push origin "v$VERSION"
- name: Clean up old prerelease tags - name: Clean up old prerelease tags
if: ${{ !env.ACT }}
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
+8 -2
View File
@@ -174,15 +174,16 @@ jobs:
retention-days: 1 retention-days: 1
merge: merge:
if: ${{ !env.ACT }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [version-bump, build] needs: [version-bump, build]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
if: ${{ !env.ACT }}
with: with:
ref: main ref: main
- name: Download build digests - name: Download build digests
if: ${{ !env.ACT }}
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
path: /tmp/digests path: /tmp/digests
@@ -190,13 +191,16 @@ jobs:
merge-multiple: true merge-multiple: true
- uses: docker/setup-buildx-action@v3 - uses: docker/setup-buildx-action@v3
if: ${{ !env.ACT }}
- uses: docker/login-action@v3 - uses: docker/login-action@v3
if: ${{ !env.ACT }}
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create and push multi-arch manifest - name: Create and push multi-arch manifest
if: ${{ !env.ACT }}
working-directory: /tmp/digests working-directory: /tmp/digests
run: | run: |
VERSION="${{ needs.version-bump.outputs.version }}" VERSION="${{ needs.version-bump.outputs.version }}"
@@ -209,19 +213,21 @@ jobs:
"${digests[@]}" "${digests[@]}"
- name: Inspect manifest - name: Inspect manifest
if: ${{ !env.ACT }}
run: docker buildx imagetools inspect mauriceboe/trek:latest run: docker buildx imagetools inspect mauriceboe/trek:latest
release-helm: release-helm:
if: ${{ !env.ACT }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: version-bump needs: version-bump
steps: steps:
- name: Checkout - name: Checkout
if: ${{ !env.ACT }}
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: main ref: main
- name: Publish Helm chart - name: Publish Helm chart
if: ${{ !env.ACT }}
uses: stefanprodan/helm-gh-pages@v1.7.0 uses: stefanprodan/helm-gh-pages@v1.7.0
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
+2
View File
@@ -25,11 +25,13 @@ jobs:
tags: trek:scan tags: trek:scan
- uses: docker/login-action@v3 - uses: docker/login-action@v3
if: ${{ !env.ACT }}
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/scout-action@v1 - uses: docker/scout-action@v1
if: ${{ !env.ACT }}
with: with:
command: cves command: cves
image: trek:scan image: trek:scan