File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8989 echo "build_arch=false" >> $GITHUB_OUTPUT;
9090 elif [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then
9191 echo "build_arch=true" >> $GITHUB_OUTPUT;
92- echo "image=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)" >> $GITHUB_OUTPUT;
92+
93+ # Determine image suffix based on branch
94+ if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
95+ # Main branch: remove -canary suffix if present
96+ image_name=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3 | sed 's/-canary$//')
97+ else
98+ # Other branches (including canary): keep -canary suffix
99+ image_name=$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)
100+ if [[ ! "$image_name" =~ -canary$ ]]; then
101+ image_name="${image_name}-canary"
102+ fi
103+ fi
104+
105+ echo "image=$image_name" >> $GITHUB_OUTPUT;
93106 if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then
94107 echo "BUILD_ARGS=" >> $GITHUB_ENV;
95108 fi
You can’t perform that action at this time.
0 commit comments