Commit fcbbe9e
authored
fix(build-container-bake): retry the Syft download once (#374)
Addresses the first half of #373.
## Why
`anchore/sbom-action` downloads Syft at run time. That download failed
twice in one evening on `netresearch/typo3-demo`:
| time (UTC) | run |
|---|---|
| 17:27 |
[31622180041](https://github.com/netresearch/typo3-demo/actions/runs/31622180041)
|
| 19:32 |
[31633121104](https://github.com/netresearch/typo3-demo/actions/runs/31633121104)
|
Both recovered on a plain re-run with no repository change, and other
builds of nearly the same image passed in between — so it is the
download, not the image.
Each failure cost a deployment. The SBOM job failing skips `validate`,
and the consuming repo's Deploy workflow triggers on `workflow_run` of
Build with `conclusion == 'success'`. Both times the container itself
had already built successfully; only the inventory of it was missing.
The same evening produced two more installer failures in unrelated jobs
on that repo (Opengrep, betterleaks — both at their install step, both
green on re-run), which is why #373 reads this as GitHub release
downloads being unreliable rather than anything specific to this
workflow.
## What this changes
The first attempt gets `continue-on-error: true` and an `id`; a second,
identical step runs only `if: steps.syft.outcome == 'failure'`.
Chosen over a retry action because there is nothing new to pin and
audit, and because the second attempt appears as its own step in the run
rather than disappearing into a wrapper's output.
| case | behaviour |
|---|---|
| first attempt succeeds | second is skipped |
| first fails, second succeeds | job continues, SBOM present |
| both fail | **job fails** — the second step has no `continue-on-error`
|
## What this does not change
Whether a missing SBOM should be allowed to stop a release. That is the
second option in #373 and a supply-chain policy question, not mine to
decide — the coupling stays exactly as it is.
## Verification
Structural: the step order and the `if` guard are as listed above, and
the file parses. I have not induced a Syft download failure to watch the
retry fire; the behaviour rests on the documented semantics of
`continue-on-error` and `steps.<id>.outcome`, which distinguish outcome
from conclusion precisely for this pattern.1 file changed
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
769 | 779 | | |
| 780 | + | |
| 781 | + | |
770 | 782 | | |
771 | 783 | | |
772 | 784 | | |
| |||
787 | 799 | | |
788 | 800 | | |
789 | 801 | | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
790 | 828 | | |
791 | 829 | | |
792 | 830 | | |
| |||
0 commit comments