From 7408acd123489cc65af9df0e24c1e8e6bffd68e4 Mon Sep 17 00:00:00 2001 From: Lalit Kishore R Date: Wed, 25 Nov 2026 20:26:28 +0530 Subject: [PATCH 1/4] ci: add shared Kubescape contribution policy Signed-off-by: Lalit Kishore R --- .github/workflows/contribution-policy.yaml | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/contribution-policy.yaml diff --git a/.github/workflows/contribution-policy.yaml b/.github/workflows/contribution-policy.yaml new file mode 100644 index 0000000..84e2cfd --- /dev/null +++ b/.github/workflows/contribution-policy.yaml @@ -0,0 +1,40 @@ +name: Contribution policy automation + +on: + issues: + types: [opened, reopened, labeled, unlabeled, assigned, unassigned, closed] + issue_comment: + types: [created] + pull_request_target: + types: [opened, reopened, edited, synchronize, closed, labeled, unlabeled] + schedule: + - cron: '17 6 * * *' + workflow_dispatch: + +permissions: {} + +# The three-assignment limit is per repository. Preserve queued commands. +concurrency: + group: contribution-policy + queue: max + cancel-in-progress: false + +jobs: + policy: + if: >- + github.repository_owner == 'kubescape' && + vars.CONTRIBUTION_POLICY_START != '' && + (github.event_name != 'issue_comment' || github.event.comment.user.type != 'Bot') + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + contents: read + issues: write + pull-requests: write + statuses: write + steps: + # The rollout tool replaces this placeholder with a full reviewed commit SHA. + # No checkout: contributor code is never executed by this privileged job. + - uses: kubescape/workflows/.github/actions/contribution-policy@ebfbc6585571c9d32714c404dc5cc8b42d8811f0 + with: + start: ${{ vars.CONTRIBUTION_POLICY_START }} From 284602f917a457679e28ec3b3a7dd498447973ff Mon Sep 17 00:00:00 2001 From: Lalit Kishore R Date: Wed, 25 Nov 2026 20:55:28 +0530 Subject: [PATCH 2/4] ci: pin non-assignee and duplicate closure policy Signed-off-by: Lalit Kishore R --- .github/workflows/contribution-policy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/contribution-policy.yaml b/.github/workflows/contribution-policy.yaml index 84e2cfd..cbd467a 100644 --- a/.github/workflows/contribution-policy.yaml +++ b/.github/workflows/contribution-policy.yaml @@ -35,6 +35,6 @@ jobs: steps: # The rollout tool replaces this placeholder with a full reviewed commit SHA. # No checkout: contributor code is never executed by this privileged job. - - uses: kubescape/workflows/.github/actions/contribution-policy@ebfbc6585571c9d32714c404dc5cc8b42d8811f0 + - uses: kubescape/workflows/.github/actions/contribution-policy@7ef1993c655a31e183d2339599cae98cd21069e4 with: start: ${{ vars.CONTRIBUTION_POLICY_START }} From 60a9169beb02e9fa66af4e98bb9657c487be1ccc Mon Sep 17 00:00:00 2001 From: Lalit Kishore R Date: Wed, 25 Nov 2026 21:12:38 +0530 Subject: [PATCH 3/4] docs: clarify contribution workflow concurrency and pin prerequisites Signed-off-by: Lalit Kishore R --- .github/workflows/contribution-policy.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/contribution-policy.yaml b/.github/workflows/contribution-policy.yaml index cbd467a..54f4d82 100644 --- a/.github/workflows/contribution-policy.yaml +++ b/.github/workflows/contribution-policy.yaml @@ -14,6 +14,7 @@ on: permissions: {} # The three-assignment limit is per repository. Preserve queued commands. +# queue: max is supported: https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency#example-queueing-multiple-pending-runs concurrency: group: contribution-policy queue: max @@ -33,7 +34,7 @@ jobs: pull-requests: write statuses: write steps: - # The rollout tool replaces this placeholder with a full reviewed commit SHA. + # Before activation, verify this pinned action commit is on kubescape/workflows main. # No checkout: contributor code is never executed by this privileged job. - uses: kubescape/workflows/.github/actions/contribution-policy@7ef1993c655a31e183d2339599cae98cd21069e4 with: From af525815e78fe52fc62c6a34c6f5a8e845faa196 Mon Sep 17 00:00:00 2001 From: Lalit Kishore R Date: Wed, 25 Nov 2026 21:39:33 +0530 Subject: [PATCH 4/4] ci: pin contribution policy review fixes Signed-off-by: Lalit Kishore R --- .github/workflows/contribution-policy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/contribution-policy.yaml b/.github/workflows/contribution-policy.yaml index 54f4d82..cfe01a2 100644 --- a/.github/workflows/contribution-policy.yaml +++ b/.github/workflows/contribution-policy.yaml @@ -32,10 +32,10 @@ jobs: contents: read issues: write pull-requests: write - statuses: write + checks: write steps: # Before activation, verify this pinned action commit is on kubescape/workflows main. # No checkout: contributor code is never executed by this privileged job. - - uses: kubescape/workflows/.github/actions/contribution-policy@7ef1993c655a31e183d2339599cae98cd21069e4 + - uses: kubescape/workflows/.github/actions/contribution-policy@b65263209ccb370f0cb508f776cde7850ebfb6ee with: start: ${{ vars.CONTRIBUTION_POLICY_START }}