diff --git a/.github/actions/check-submodule-reference/action.yml b/.github/actions/check-submodule-reference/action.yml deleted file mode 100644 index fd3b18f4bb..0000000000 --- a/.github/actions/check-submodule-reference/action.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "Check submodule reference" -description: "Check that submodule references a commit in a submodule repository's branch" - -inputs: - submodule_path: - description: "directory with the submodule" - required: true - branch: - description: "branch in the submodule repository" - required: true - -runs: - using: "composite" - - steps: - - name: Check ${{ inputs.submodule_path }} submodule reference - shell: bash -euxo pipefail {0} - run: | - cd ${{ inputs.submodule_path }} - git fetch origin "refs/heads/${{ inputs.branch }}:refs/heads/origin/${{ inputs.branch }}" - RC=$(git merge-base --is-ancestor origin/${{ inputs.branch }} HEAD; echo $?) - if [ "$RC" != "0" ]; then - echo "${{ inputs.submodule_path }} submodule is not an ancestor of the ${{ inputs.branch }} branch. Please rebase it" - exit 1 - fi diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 22137937be..d3eb0266aa 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -130,35 +130,45 @@ jobs: with: submodules: true - # We need more history, to find the common ancestor between each REL_14_* branch. - # 3 months should be plenty. - - name: Checkout more history - id: checkout-deeper - run: git submodule foreach git fetch --shallow-since='3 months' - - name: Check vendor/postgres-v14 submodule reference - uses: ./.github/actions/check-submodule-reference + uses: jtmullen/submodule-branch-check-action@v1 with: - submodule_path: vendor/postgres-v14 - branch: REL_14_STABLE_neon + path: "vendor/postgres-v14" + branch: "REL_14_STABLE_neon" + fetch_depth: "50" + sub_fetch_depth: "50" + first_parent: true + pass_if_unchanged: true - name: Check vendor/postgres-v15 submodule reference - uses: ./.github/actions/check-submodule-reference + uses: jtmullen/submodule-branch-check-action@v1 with: - submodule_path: vendor/postgres-v15 - branch: REL_15_STABLE_neon + path: "vendor/postgres-v15" + branch: "REL_15_STABLE_neon" + fetch_depth: "50" + sub_fetch_depth: "50" + first_parent: true + pass_if_unchanged: true - name: Check vendor/postgres-v16 submodule reference - uses: ./.github/actions/check-submodule-reference + uses: jtmullen/submodule-branch-check-action@v1 with: - submodule_path: vendor/postgres-v16 - branch: REL_16_STABLE_neon + path: "vendor/postgres-v16" + branch: "REL_16_STABLE_neon" + fetch_depth: "50" + sub_fetch_depth: "50" + first_parent: true + pass_if_unchanged: true - name: Check vendor/postgres-v17 submodule reference - uses: ./.github/actions/check-submodule-reference + uses: jtmullen/submodule-branch-check-action@v1 with: - submodule_path: vendor/postgres-v17 - branch: REL_17_STABLE_neon + path: "vendor/postgres-v17" + branch: "REL_17_STABLE_neon" + fetch_depth: "50" + sub_fetch_depth: "50" + first_parent: true + pass_if_unchanged: true check-codestyle-rust: needs: [ check-permissions, build-build-tools-image ]