Read no-cache from the event payload as well
The runner evaluates a caller's with: expression again inside the called workflow, where the event is workflow_call, so no-cache: gitea.event_name == 'schedule' was always false: weekly rebuilds reused the cached upgrade layers and never got their YYYYMMDD tag. The payload carries the value Gitea computed for the caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
066828db4a
commit
05f8e18f1f
1 file changed
+7
-2
@@ -42,6 +42,12 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ inputs.runs-on }}
|
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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
@@ -83,7 +89,7 @@ jobs:
|
|||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=sha,prefix=,format=short
|
type=sha,prefix=,format=short
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
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
|
# 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,
|
# multi-platform image can't be loaded), scanned against the Trivy server,
|
||||||
@@ -100,7 +106,6 @@ jobs:
|
|||||||
SEVERITY: ${{ inputs.severity }}
|
SEVERITY: ${{ inputs.severity }}
|
||||||
VERSION: ${{ steps.meta.outputs.version }}
|
VERSION: ${{ steps.meta.outputs.version }}
|
||||||
BUILD_ARGS: ${{ inputs.build-args }}
|
BUILD_ARGS: ${{ inputs.build-args }}
|
||||||
NO_CACHE: ${{ inputs.no-cache }}
|
|
||||||
TRIVY_SERVER: ${{ vars.TRIVY_SERVER || 'http://localhost:4954' }}
|
TRIVY_SERVER: ${{ vars.TRIVY_SERVER || 'http://localhost:4954' }}
|
||||||
TRIVY_TOKEN: ${{ secrets.TRIVY_TOKEN }}
|
TRIVY_TOKEN: ${{ secrets.TRIVY_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in new issue
Block a user