diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index f48015a..ac34d17 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -42,6 +42,12 @@ env: jobs: build: runs-on: ${{ inputs.runs-on }} + env: + # The runner evaluates a caller's `with:` expression again in here, where + # the event is workflow_call, so the callers' `gitea.event_name == + # 'schedule'` always came out false and weekly rebuilds stayed cached. + # The event payload carries the value Gitea computed for the caller. + NO_CACHE: ${{ (inputs.no-cache || github.event.inputs['no-cache']) == true }} steps: - name: Checkout uses: actions/checkout@v7 @@ -83,7 +89,7 @@ jobs: type=semver,pattern={{version}} type=sha,prefix=,format=short type=raw,value=latest,enable={{is_default_branch}} - type=raw,value={{date 'YYYYMMDD'}},enable=${{ inputs.no-cache }} + type=raw,value={{date 'YYYYMMDD'}},enable=${{ env.NO_CACHE }} # Each platform is built into the local Docker daemon on its own (a # multi-platform image can't be loaded), scanned against the Trivy server, @@ -100,7 +106,6 @@ jobs: SEVERITY: ${{ inputs.severity }} VERSION: ${{ steps.meta.outputs.version }} BUILD_ARGS: ${{ inputs.build-args }} - NO_CACHE: ${{ inputs.no-cache }} TRIVY_SERVER: ${{ vars.TRIVY_SERVER || 'http://localhost:4954' }} TRIVY_TOKEN: ${{ secrets.TRIVY_TOKEN }} run: |