Commit 97e96f2
Fix the release workflow's cache scope and branch selection (#37)
Two fixes to the release workflow #36 added. No new functionality —
`Dockerfile` and the multi-arch build itself are untouched.
## The multi-platform cache scope was invalid
```yaml
cache-from: type=gha,scope=release-${{ inputs.platforms }}
```
expanded to `type=gha,scope=release-linux/amd64,linux/arm64`. A
`type=gha` value is itself a comma-separated key=value list, so the
comma inside the platform list terminated `scope` and buildx read the
leftover `linux/arm64` as a bare key:
```
ERROR: invalid value linux/arm64
```
That killed the run before any build step, so **any dispatch with the
default multi-platform list failed**. Only a single-platform run (no
comma) got through.
Both cache flags now use one shared `release` scope. The
per-platform-set keying it replaces wasn't worth having: GHA cache
scopes are separate namespaces, so sharing one lets a single-platform
run reuse layers a multi-arch run already cached instead of starting
cold.
## The `branch` input silently overrode the branch you picked
There were two branch selectors, and the one you didn't touch won. **Use
workflow from** chose which `release.yml` ran; the `branch` input chose
what got checked out and tagged — and it defaulted to `master`.
Dispatching from a feature branch and leaving the input alone therefore
ran that branch's workflow against master's tree and pushed
`master-<sha>`, `master`, `latest`.
The input is gone. `actions/checkout` now takes no `ref:` at all, so it
uses the dispatch commit, and the tag slug comes from `github.ref_name`.
One branch picker, and no way for the built ref to disagree with it.
Remaining inputs: `image`, `extra_tag`, `latest`, `platforms`.
## README
Updated to match: **Use workflow from** is the only branch to choose,
and the `/`-to-`-` tag slugification is now stated.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01TzoV12kHAHm6EFNmUfZedq
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 619314e commit 97e96f2
2 files changed
Lines changed: 26 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| 36 | + | |
| 37 | + | |
37 | 38 | | |
38 | | - | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | | - | |
| 59 | + | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
115 | | - | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| |||
0 commit comments