From 7caa740f0dca2da7dfd4a1a4192d9a984d33d12f Mon Sep 17 00:00:00 2001 From: illuminatus Date: Sun, 3 Sep 2023 15:39:21 -0700 Subject: [PATCH] branch as input for premerge workflow (#1683) branch as input allowing manual workflow dispatch --- .github/workflows/premerge.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/premerge.yml b/.github/workflows/premerge.yml index f75d13387..ef675d7e4 100644 --- a/.github/workflows/premerge.yml +++ b/.github/workflows/premerge.yml @@ -2,6 +2,10 @@ name: Pre-merge on: workflow_dispatch: + inputs: + branch: + description: 'Branch to test' + required: true pull_request: paths: - scripts/cnode-helper-scripts/guild-deploy.sh @@ -16,6 +20,7 @@ jobs: distro: [rockylinux, ubuntu] env: REGISTRY: ghcr.io + BRANCH: ${{ github.event.inputs.branch || '' }} if: github.event.pull_request.draft == false steps: - name: Provide additional free space @@ -42,9 +47,13 @@ jobs: - uses: actions/checkout@v3 - name: Define BRANCH, COMMIT and G_ACCOUNT in environment run: | - echo "BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV echo "G_ACCOUNT=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV - echo "COMMIT=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV + if [[ -z ${{ env.BRANCH }} ]]; then + echo "BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + echo "COMMIT=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV + else + echo "COMMIT=$(git rev-parse --short ${{ env.BRANCH }})" >> $GITHUB_ENV + fi - name: Testing guild-deploy.sh (IO fork of libsodium) run: | docker build . \