diff --git a/.github/workflows/00-pr-scanner.yaml b/.github/workflows/00-pr-scanner.yaml index 78287d42..0241f87b 100644 --- a/.github/workflows/00-pr-scanner.yaml +++ b/.github/workflows/00-pr-scanner.yaml @@ -15,9 +15,11 @@ on: - 'docs/*' - 'build/*' - '.github/*' + concurrency: - group: ${{ github.head_ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true + jobs: pr-scanner: permissions: diff --git a/.github/workflows/01-code-review-approved.yaml b/.github/workflows/01-code-review-approved.yaml deleted file mode 100644 index 712c89c0..00000000 --- a/.github/workflows/01-code-review-approved.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: 01-code_review_approved -on: - pull_request_review: - types: [submitted] - branches: - - 'master' - - 'main' - paths-ignore: - - '**.yaml' - - '**.md' - - '**.sh' - - 'website/*' - - 'examples/*' - - 'docs/*' - - 'build/*' - - '.github/*' -concurrency: - group: code-review-approved - cancel-in-progress: true -jobs: - binary-build: - if: ${{ github.event.review.state == 'approved' && contains( github.event.pull_request.labels.*.name, 'trigger-integration-test') && github.event.pull_request.base.ref == 'master' }} ## run only if labeled as "trigger-integration-test" and base branch is master - uses: ./.github/workflows/b-binary-build-and-e2e-tests.yaml - with: - COMPONENT_NAME: kubescape - CGO_ENABLED: 1 - GO111MODULE: "" - GO_VERSION: "1.19" - RELEASE: "" - CLIENT: test - secrets: inherit - merge-to-master: - needs: binary-build - env: - GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - if: ${{ (github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master') && (always() && (contains(needs.*.result, 'success') || contains(needs.*.result, 'skipped')) && !(contains(needs.*.result, 'failure')) && !(contains(needs.*.result, 'cancelled'))) }} - runs-on: ubuntu-latest - steps: - - name: merge-to-master - if: ${{ env.GH_PERSONAL_ACCESS_TOKEN }} - uses: pascalgn/automerge-action@eb68b061739cb9d81564f8e812d0b3c45f0fb09a # ratchet:pascalgn/automerge-action@v0.15.5 - env: - GITHUB_TOKEN: "${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}" - MERGE_COMMIT_MESSAGE: "Merge to master - PR number: {pullRequest.number}" - MERGE_ERROR_FAIL: "true" - MERGE_METHOD: "merge" - MERGE_LABELS: "" - UPDATE_LABELS: "" diff --git a/.github/workflows/01-pr-merged.yaml b/.github/workflows/01-pr-merged.yaml new file mode 100644 index 00000000..63e31591 --- /dev/null +++ b/.github/workflows/01-pr-merged.yaml @@ -0,0 +1,34 @@ +name: 01-pr-merged + +on: + pull_request_target: + types: [closed] + branches: + - 'master' + - 'main' + paths-ignore: + - '**.yaml' + - '**.md' + - '**.sh' + - 'website/*' + - 'examples/*' + - 'docs/*' + - 'build/*' + - '.github/*' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + binary-build: + if: ${{ github.event.pull_request.merged == true && contains( github.event.pull_request.labels.*.name, 'trigger-integration-test') && github.event.pull_request.base.ref == 'master' }} ## run only if labeled as "trigger-integration-test" and base branch is master + uses: ./.github/workflows/b-binary-build-and-e2e-tests.yaml + with: + COMPONENT_NAME: kubescape + CGO_ENABLED: 1 + GO111MODULE: "" + GO_VERSION: "1.19" + RELEASE: "" + CLIENT: test + secrets: inherit \ No newline at end of file