Skip to content

ci: delay checking ci/skip/multi-arch-build label #11609

ci: delay checking ci/skip/multi-arch-build label

ci: delay checking ci/skip/multi-arch-build label #11609

---
name: multi-arch-build
# yamllint disable-line rule:truthy
on:
pull_request:
branches:
- '*'
permissions:
contents: read
# cancel the in-progress workflow when PR is refreshed.
concurrency:
# yamllint disable-line rule:truthy rule:line-length
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
codespell:
name: multi-arch-build
runs-on: ubuntu-latest
steps:
- name: detect single-arch-build
id: detect-single-arch-build
# wait 1 minute because setting labels may be delayed
run: |
sleep 1m
PR=${{ github.event.pull_request.number }}
( echo -n 'is-single-arch-build='
curl --silent --location \
--header "Accept: application/vnd.github+json" \
--header "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/ceph/ceph-csi/pulls/${PR}" | \
jq "[.labels[].name]|any(. == \"ci/skip/multi-arch-build\")" \
) >> ${GITHUB_OUTPUT}
# yamllint disable-line rule:line-length
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: multi-arch-build
if: steps.detect-single-arch-build.output.is-single-arch-build != 'true'
# podman cannot pull images with both tag and digest
# https://github.com/containers/buildah/issues/1407
# use docker to build images
run: CONTAINER_CMD=docker ./scripts/build-multi-arch-image.sh
- name: single-arch-build
if: steps.detect-single-arch-build.output.is-single-arch-build == 'true'
run: make containerized-build