diff --git a/.github/workflows/ats-ci.yml b/.github/workflows/ats-ci.yml index 294d50c25..6379b7064 100644 --- a/.github/workflows/ats-ci.yml +++ b/.github/workflows/ats-ci.yml @@ -6,12 +6,15 @@ on: - '**' push: branches: - - '**' + - master tags-ignore: - ats-* + pull_request: + branches: + - master jobs: - build: + build: strategy: matrix: os: [ ubuntu-latest, ubuntu-24.04-arm ] @@ -28,7 +31,11 @@ jobs: id: branch working-directory: Docker run: | - echo "ATS_BRANCH=$GITHUB_REF_NAME" >> $GITHUB_ENV + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "ATS_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV + else + echo "ATS_BRANCH=$GITHUB_REF_NAME" >> $GITHUB_ENV + fi - name: Does Amanzi branch of the same name exist? id: amanzi_branch run: | @@ -103,7 +110,11 @@ jobs: id: branch working-directory: Docker run: | - echo "ATS_BRANCH=$GITHUB_REF_NAME" >> $GITHUB_ENV + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "ATS_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV + else + echo "ATS_BRANCH=$GITHUB_REF_NAME" >> $GITHUB_ENV + fi - name: Filter the branch name to generate a tag for Docker id: tag run: | @@ -138,7 +149,11 @@ jobs: id: branch working-directory: Docker run: | - echo "ATS_BRANCH=$GITHUB_REF_NAME" >> $GITHUB_ENV + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "ATS_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV + else + echo "ATS_BRANCH=$GITHUB_REF_NAME" >> $GITHUB_ENV + fi - name: Filter the branch name to generate a tag for Docker id: tag run: | @@ -169,7 +184,11 @@ jobs: - name: Filter the branch name to generate a tag for Docker id: tag run: | - echo "ATS_BRANCH_TAG=$(echo $GITHUB_REF_NAME | sed -e 's/\//--/g')" >> $GITHUB_ENV + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "ATS_BRANCH_TAG=$(echo ${{ github.event.pull_request.head.ref }} | sed -e 's/\//--/g')" >> $GITHUB_ENV + else + echo "ATS_BRANCH_TAG=$GITHUB_REF_NAME | sed -e 's/\//--/g')" >> $GITHUB_ENV + fi - name: Login to Docker Hub uses: docker/login-action@v3 with: