From 7c18042e6d6d6401844f228e5a111666a7bafc8b Mon Sep 17 00:00:00 2001 From: Reynold Morel Date: Sun, 1 Sep 2024 09:37:51 -0400 Subject: [PATCH] testing --- .github/workflows/rit.yml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rit.yml b/.github/workflows/rit.yml index 4a4b9621b22..079a5053590 100644 --- a/.github/workflows/rit.yml +++ b/.github/workflows/rit.yml @@ -5,6 +5,10 @@ on: branches: - "master" - "*-rc" + pull_request: + types: [opened, reopened, synchronize] + branches: + - "**" workflow_dispatch: inputs: rit-branch: @@ -21,25 +25,37 @@ jobs: name: Rootstock Integration Tests runs-on: ubuntu-latest timeout-minutes: 60 + permissions: + contents: write + packages: write + issues: read + pull-requests: write + actions: read + deployments: read steps: - name: Set Branch Variables id: set-branch-variables run: | + # Default values + RSKJ_BRANCH="unknown" + RIT_BRANCH="${{ github.event.inputs.rit-branch || 'main' }}" + POWPEG_BRANCH="${{ github.event.inputs.powpeg-branch || 'master' }}" + if [[ "${{ github.event_name }}" == "push" ]]; then - # Determine branch name for push event if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then - echo "RSKJ_BRANCH=master" >> $GITHUB_ENV - elif [[ "${{ github.ref }}" == refs/heads/*-rc ]]; then - branch_name="${{ github.ref#refs/heads/}}" - echo "RSKJ_BRANCH=$branch_name" >> $GITHUB_ENV + RSKJ_BRANCH="master" + elif [[ "${{ github.ref }}" =~ refs/heads/(.*)-rc ]]; then + RSKJ_BRANCH="${BASH_REMATCH[1]}-rc" + else + RSKJ_BRANCH="${{ github.ref#refs/heads/ }}" fi elif [[ "${{ github.event_name }}" == "pull_request" ]]; then - # Use the PR branch name for pull request events - echo "RSKJ_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV + RSKJ_BRANCH="${{ github.event.pull_request.head.ref }}" fi - echo "RIT_BRANCH=${{ github.event.inputs.rit-branch }}" >> $GITHUB_ENV - echo "POWPEG_BRANCH=${{ github.event.inputs.powpeg-branch }}" >> $GITHUB_ENV + echo "RSKJ_BRANCH=$RSKJ_BRANCH" >> $GITHUB_ENV + echo "RIT_BRANCH=$RIT_BRANCH" >> $GITHUB_ENV + echo "POWPEG_BRANCH=$POWPEG_BRANCH" >> $GITHUB_ENV echo "RSKJ_BRANCH=${{ env.RSKJ_BRANCH }}" echo "RIT_BRANCH=${{ env.RIT_BRANCH }}"