diff --git a/.github/actions/setup-maven/action.yml b/.github/actions/setup-maven/action.yml index 6edbba1b1a9..ad07d0ca004 100644 --- a/.github/actions/setup-maven/action.yml +++ b/.github/actions/setup-maven/action.yml @@ -5,7 +5,7 @@ inputs: git-reference: description: 'The git reference (branch/tag) to check out' required: true - default: 'develop' + default: 'null' pom-paths: description: "List of paths to Maven POM(s) for cache dependency setup" required: false @@ -14,9 +14,20 @@ runs: using: composite steps: - name: Checkout repository + if: ${{ inputs.git-reference != 'null' }} uses: actions/checkout@v4 with: ref: ${{ inputs.git-reference }} + - name: Checkout repository + if: ${{ inputs.git-reference == 'null' && github.event_name == 'pull_request' }} + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + - name: Checkout repository + if: ${{ inputs.git-reference == 'null' && github.event_name != 'pull_request' }} + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} - name: Determine Java version by reading the Maven property shell: bash run: | diff --git a/.github/workflows/container_app_push.yml b/.github/workflows/container_app_push.yml index 7f0c4a6d86d..a87bc73a4f5 100644 --- a/.github/workflows/container_app_push.yml +++ b/.github/workflows/container_app_push.yml @@ -43,7 +43,6 @@ jobs: # TODO: change to upstream location in final PR uses: gdcc/wip-dataverse-base-image/.github/actions/setup-maven@10478-version-base-img with: - git-reference: ${{ github.ref_name }} pom-paths: | pom.xml modules/container-configbaker/pom.xml @@ -117,7 +116,6 @@ jobs: # TODO: change to upstream location in final PR uses: gdcc/wip-dataverse-base-image/.github/actions/setup-maven@10478-version-base-img with: - git-reference: ${{ github.ref_name }} pom-paths: | pom.xml modules/container-configbaker/pom.xml