diff --git a/.github/workflows/merge_build.yml b/.github/workflows/merge_build.yml index 5f4fc008f..681bf6b1d 100644 --- a/.github/workflows/merge_build.yml +++ b/.github/workflows/merge_build.yml @@ -36,16 +36,37 @@ jobs: malloc-impl: ${{ matrix.malloc-impl }} prerelease: ${{ matrix.prerelease }} tooling: ${{ matrix.tooling }} - # ChainBuild: - # runs-on: "ubuntu-22.04" - # steps: - # - name: Start HomeObject Build - # run: | - # curl -L \ - # -X POST \ - # -H "Accept: application/vnd.github+json" \ - # -H "Authorization: Bearer ${{ secrets.CHAIN_BUILD_TOKEN }}"\ - # -H "X-GitHub-Api-Version: 2022-11-28" \ - # https://api.github.com/repos/eBay/homeobject/actions/workflows/conan_build.yml/dispatches \ - # -d '{"ref":"main","inputs":{}}' - # if: ${{ github.ref == 'refs/heads/master' }} + ChainBuild: + needs: Build + runs-on: "ubuntu-24.04" + steps: + - name: Get HomeObject default branch + id: get-branch + run: | + set -euo pipefail + + DEFAULT_BRANCH=$(curl --fail --show-error --silent --location \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.CHAIN_BUILD_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/eBay/homeobject \ + | jq -r '.default_branch') + + if [ -z "$DEFAULT_BRANCH" ] || [ "$DEFAULT_BRANCH" = "null" ]; then + echo "Failed to determine HomeObject default branch from GitHub API response" >&2 + exit 1 + fi + + echo "default_branch=$DEFAULT_BRANCH" >> "$GITHUB_OUTPUT" + echo "HomeObject default branch: $DEFAULT_BRANCH" + + - name: Start HomeObject Build + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.CHAIN_BUILD_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/eBay/homeobject/actions/workflows/conan_build.yml/dispatches \ + -d '{"ref":"${{ steps.get-branch.outputs.default_branch }}","inputs":{}}' + if: ${{ github.ref == 'refs/heads/stable/v7.x' }}