From 51083fac70bc598bb4141ec578a9106682a6fa89 Mon Sep 17 00:00:00 2001 From: maancham Date: Mon, 25 Mar 2024 09:53:48 -0400 Subject: [PATCH] feat: add branch input, edit checkout step --- .../build-binaries-and-push-to-r2.yaml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-binaries-and-push-to-r2.yaml b/.github/workflows/build-binaries-and-push-to-r2.yaml index b38dadd53..65f1bd60d 100644 --- a/.github/workflows/build-binaries-and-push-to-r2.yaml +++ b/.github/workflows/build-binaries-and-push-to-r2.yaml @@ -5,22 +5,39 @@ on: branches: - main workflow_dispatch: + inputs: + branch: + description: Github branch to checkout for build + required: true + default: main + type: string jobs: build-and-upload: - name: Build binary from current commit and push to R2 + name: Build binary and push to R2 runs-on: ubuntu-22.04 permissions: contents: write packages: write id-token: write steps: + - name: Determine branch + id: get-branch-name + run: | + if [ "${{ github.event_name }}" == "push" ]; then + branch="main" + else + branch="${{ inputs.branch }}" + fi + echo "branch=branch" >> $GITHUB_OUTPUT + - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: "0" path: axelar-core submodules: recursive + ref: ${{ steps.get-branch-name.outputs.branch }} - name: Build axelard binary with version and commit hash id: build-binary