From 23502014544d79b1bdd3699aaea80e3ec4906902 Mon Sep 17 00:00:00 2001 From: Stephan Merker Date: Tue, 14 Jul 2026 17:43:12 +0200 Subject: [PATCH 1/2] Auto-merge of dependabot PRs - uses PR auto-merge feature (must be enabled on repo) - requires required status checks in branch protection (extra PR) - all actions configured as status checks must run unconditionally on a PR (i.e. no path restrictions) --- .github/workflows/alioss-integration.yml | 5 ----- .github/workflows/azurebs-integration.yml | 5 ----- .github/workflows/dav-integration.yml | 5 ----- .github/workflows/dependabot-auto-merge.yml | 15 +++++++++++++++ .github/workflows/gcs-integration.yml | 5 ----- .github/workflows/s3-integration.yml | 5 ----- 6 files changed, 15 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/dependabot-auto-merge.yml diff --git a/.github/workflows/alioss-integration.yml b/.github/workflows/alioss-integration.yml index 2f9911a..2c04b80 100644 --- a/.github/workflows/alioss-integration.yml +++ b/.github/workflows/alioss-integration.yml @@ -3,11 +3,6 @@ name: Alioss Integration Tests on: workflow_dispatch: pull_request: - paths: - - ".github/workflows/alioss-integration.yml" - - "alioss/**" - - "go.mod" - - "go.sum" push: branches: - main diff --git a/.github/workflows/azurebs-integration.yml b/.github/workflows/azurebs-integration.yml index 5f51562..0618abf 100644 --- a/.github/workflows/azurebs-integration.yml +++ b/.github/workflows/azurebs-integration.yml @@ -3,11 +3,6 @@ name: Azurebs Integration Tests on: workflow_dispatch: pull_request: - paths: - - ".github/workflows/azurebs-integration.yml" - - "azurebs/**" - - "go.mod" - - "go.sum" push: branches: - main diff --git a/.github/workflows/dav-integration.yml b/.github/workflows/dav-integration.yml index 298f733..6aa9293 100644 --- a/.github/workflows/dav-integration.yml +++ b/.github/workflows/dav-integration.yml @@ -3,11 +3,6 @@ name: DAV Integration Tests on: workflow_dispatch: pull_request: - paths: - - ".github/workflows/dav-integration.yml" - - "dav/**" - - "go.mod" - - "go.sum" push: branches: - main diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 0000000..b698a0e --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,15 @@ +name: Dependabot auto-merge + +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + auto-merge: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Enable auto-merge + run: gh pr merge --auto --rebase "${{ github.event.pull_request.number }}" diff --git a/.github/workflows/gcs-integration.yml b/.github/workflows/gcs-integration.yml index 42250cd..7fdfefb 100644 --- a/.github/workflows/gcs-integration.yml +++ b/.github/workflows/gcs-integration.yml @@ -3,11 +3,6 @@ name: GCS Integration Tests on: workflow_dispatch: pull_request: - paths: - - ".github/workflows/gcs-integration.yml" - - "gcs/**" - - "go.mod" - - "go.sum" push: branches: - "main" diff --git a/.github/workflows/s3-integration.yml b/.github/workflows/s3-integration.yml index 242a9c6..79fcec3 100644 --- a/.github/workflows/s3-integration.yml +++ b/.github/workflows/s3-integration.yml @@ -3,11 +3,6 @@ name: S3 Integration Tests on: workflow_dispatch: pull_request: - paths: - - ".github/workflows/s3-integration.yml" - - "s3/**" - - "go.mod" - - "go.sum" push: branches: - main From 603e1abc0d6ba32ad9e1c586f62ef0a2e5d7acd2 Mon Sep 17 00:00:00 2001 From: Stephan Merker Date: Wed, 15 Jul 2026 11:03:09 +0200 Subject: [PATCH 2/2] /run-integration comment for fork PRs - approvers can trigger integration tests on PRs from forks AFTER reviewing the PR - green integration tests are required for merging a PR (status checks) --- .github/workflows/alioss-integration.yml | 7 +++ .github/workflows/azurebs-integration.yml | 7 +++ .github/workflows/dav-integration.yml | 7 +++ .github/workflows/dependabot-auto-merge.yml | 2 +- .../workflows/fork-integration-trigger.yml | 48 +++++++++++++++++++ .github/workflows/gcs-integration.yml | 13 ++++- .github/workflows/s3-integration.yml | 11 +++++ 7 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/fork-integration-trigger.yml diff --git a/.github/workflows/alioss-integration.yml b/.github/workflows/alioss-integration.yml index 2c04b80..882a290 100644 --- a/.github/workflows/alioss-integration.yml +++ b/.github/workflows/alioss-integration.yml @@ -2,6 +2,11 @@ name: Alioss Integration Tests on: workflow_dispatch: + inputs: + pr_ref: + description: 'SHA of the PR head commit (for fork PRs)' + required: false + default: '' pull_request: push: branches: @@ -23,6 +28,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v7 + with: + ref: ${{ inputs.pr_ref || github.sha }} - name: Set up Go uses: actions/setup-go@v6 with: diff --git a/.github/workflows/azurebs-integration.yml b/.github/workflows/azurebs-integration.yml index 0618abf..b6412e1 100644 --- a/.github/workflows/azurebs-integration.yml +++ b/.github/workflows/azurebs-integration.yml @@ -2,6 +2,11 @@ name: Azurebs Integration Tests on: workflow_dispatch: + inputs: + pr_ref: + description: 'SHA of the PR head commit (for fork PRs)' + required: false + default: '' pull_request: push: branches: @@ -23,6 +28,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v7 + with: + ref: ${{ inputs.pr_ref || github.sha }} - name: Set up Go uses: actions/setup-go@v6 with: diff --git a/.github/workflows/dav-integration.yml b/.github/workflows/dav-integration.yml index 6aa9293..8a60a5f 100644 --- a/.github/workflows/dav-integration.yml +++ b/.github/workflows/dav-integration.yml @@ -2,6 +2,11 @@ name: DAV Integration Tests on: workflow_dispatch: + inputs: + pr_ref: + description: 'SHA of the PR head commit (for fork PRs)' + required: false + default: '' pull_request: push: branches: @@ -23,6 +28,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v7 + with: + ref: ${{ inputs.pr_ref || github.sha }} - name: Set up Go uses: actions/setup-go@v6 diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index b698a0e..626c734 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -9,7 +9,7 @@ permissions: jobs: auto-merge: runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} + if: github.actor == 'dependabot[bot]' steps: - name: Enable auto-merge run: gh pr merge --auto --rebase "${{ github.event.pull_request.number }}" diff --git a/.github/workflows/fork-integration-trigger.yml b/.github/workflows/fork-integration-trigger.yml new file mode 100644 index 0000000..071590c --- /dev/null +++ b/.github/workflows/fork-integration-trigger.yml @@ -0,0 +1,48 @@ +name: Trigger integration tests for fork PRs + +on: + issue_comment: + types: [created] + +permissions: + pull-requests: write + +jobs: + trigger: + name: Trigger integration tests + runs-on: ubuntu-latest + if: | + github.event.issue.pull_request != null && + contains(github.event.comment.body, '/run-integration') + steps: + - name: Check commenter has write permission + run: | + permission=$(gh api repos/$GITHUB_REPOSITORY/collaborators/${{ github.actor }}/permission --jq '.permission') + if [[ "$permission" != "write" && "$permission" != "admin" ]]; then + echo "${{ github.actor }} does not have write permission (got: $permission)" + exit 1 + fi + + - name: Get PR head SHA and check for fork + id: pr + run: | + pr=$(gh pr view ${{ github.event.issue.number }} --json headRefOid,isCrossRepository) + read -r ref is_fork < <(echo "$pr" | jq -r '[.headRefOid, (.isCrossRepository | tostring)] | @tsv') + if [[ "$is_fork" == "false" ]]; then + echo "This command is only needed for fork PRs. Integration tests run automatically for PRs from this repository." + exit 1 + fi + echo "ref=$ref" >> $GITHUB_OUTPUT + + - name: Add reaction to comment + run: | + gh api --method POST \ + repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \ + -f content=rocket + + - name: Trigger integration tests + run: | + for workflow in s3-integration.yml gcs-integration.yml alioss-integration.yml azurebs-integration.yml dav-integration.yml; do + gh workflow run "$workflow" --ref ${{ github.event.repository.default_branch }} -f pr_ref=${{ steps.pr.outputs.ref }} & + done + wait diff --git a/.github/workflows/gcs-integration.yml b/.github/workflows/gcs-integration.yml index 7fdfefb..ff2b1f9 100644 --- a/.github/workflows/gcs-integration.yml +++ b/.github/workflows/gcs-integration.yml @@ -2,6 +2,11 @@ name: GCS Integration Tests on: workflow_dispatch: + inputs: + pr_ref: + description: 'SHA of the PR head commit (for fork PRs)' + required: false + default: '' pull_request: push: branches: @@ -22,7 +27,9 @@ jobs: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) steps: - name: Checkout code - uses: actions/checkout@v7 + uses: actions/checkout@v7 + with: + ref: ${{ inputs.pr_ref || github.sha }} - name: Set up Go uses: actions/setup-go@v6 with: @@ -57,7 +64,9 @@ jobs: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) steps: - name: Checkout code - uses: actions/checkout@v7 + uses: actions/checkout@v7 + with: + ref: ${{ inputs.pr_ref || github.sha }} - name: Set up Go uses: actions/setup-go@v6 with: diff --git a/.github/workflows/s3-integration.yml b/.github/workflows/s3-integration.yml index 79fcec3..60d4363 100644 --- a/.github/workflows/s3-integration.yml +++ b/.github/workflows/s3-integration.yml @@ -2,6 +2,11 @@ name: S3 Integration Tests on: workflow_dispatch: + inputs: + pr_ref: + description: 'SHA of the PR head commit (for fork PRs)' + required: false + default: '' pull_request: push: branches: @@ -27,6 +32,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v7 + with: + ref: ${{ inputs.pr_ref || github.sha }} - name: Set up test environment uses: ./.github/actions/go-test-bootstrap @@ -113,6 +120,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v7 + with: + ref: ${{ inputs.pr_ref || github.sha }} - name: Set up test environment uses: ./.github/actions/go-test-bootstrap @@ -156,6 +165,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v7 + with: + ref: ${{ inputs.pr_ref || github.sha }} - name: Set up test environment uses: ./.github/actions/go-test-bootstrap