Skip to content

Commit 2c4cc36

Browse files
BKPepeAnsuel
authored andcommitted
multi-arch-test-build: add fallback if openwrt-version is not found
This might be a rare case, but it happened when I forked the packages repository under my account, created a PR against the packages repository, and then someone created a PR against my feature branch, which I had submitted to the packages repository. CI/CD was trying to look for target-featurebranch e.g. aarch64-generic-MyFeatureBranch and thus it failed: buildx failed with: ERROR: failed to build: failed to solve: ghcr.io/openwrt/sdk:aarch64_generic-MyFeatureBranch: failed to resolve source metadata for ghcr.io/openwrt/sdk:aarch64_generic-MyFeatureBranch: ghcr.io/openwrt/sdk:aarch64_generic-MyFeatureBranch: not found If there isn't an openwrt-version match, fall back to building for the OpenWrt master branch (snapshot builds). Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
1 parent 2d618fc commit 2c4cc36

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/multi-arch-test-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ jobs:
7171
- name: Determine branch name
7272
run: |
7373
BRANCH="${GITHUB_BASE_REF#refs/heads/}"
74+
case "$BRANCH" in
75+
main|master|openwrt-[0-9]*\.[0-9]*)
76+
;;
77+
*)
78+
BRANCH="master"
79+
;;
80+
esac
7481
echo "Building for $BRANCH"
7582
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
7683

0 commit comments

Comments
 (0)