mirror of
https://github.com/bitnami/containers.git
synced 2026-02-19 22:17:24 +08:00
[bitnami/*] Merge automated PRs instead of enabling auto-merge (#16824)
[bitnami/*] Merge automated PRs once tests run ok Signed-off-by: Fran Mulero <fmulero@vmware.com>
This commit is contained in:
30
.github/workflows/ci-pipeline.yml
vendored
30
.github/workflows/ci-pipeline.yml
vendored
@@ -165,21 +165,33 @@ jobs:
|
||||
contains(github.event.pull_request.labels.*.name, 'auto-merge') &&
|
||||
github.event.pull_request.user.login == 'bitnami-bot'
|
||||
steps:
|
||||
- name: Enable auto-merge feature
|
||||
if: ${{ needs.verification-summary.outputs.result == 'success' }}
|
||||
uses: reitermarkus/automerge@v2.2.0
|
||||
with:
|
||||
# Necessary to trigger CD workflow
|
||||
token: ${{ secrets.BITNAMI_BOT_TOKEN }}
|
||||
merge-method: squash
|
||||
pull-request: ${{ github.event.number }}
|
||||
# Approve the CI's PR if the 'VIB Verify' job succeeded
|
||||
# Approved by the 'github-actions' user; a PR can't be approved by its author
|
||||
- name: PR Approval
|
||||
if: ${{ needs.verification-summary.outputs.result == 'success' }}
|
||||
uses: hmarr/auto-approve-action@v3.0.0
|
||||
with:
|
||||
pull-request-number: ${{ github.event.number }}
|
||||
- name: Merge
|
||||
id: merge
|
||||
if: ${{ needs.verification-summary.outputs.result == 'success' }}
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
result-encoding: string
|
||||
retries: 3
|
||||
# Necessary to trigger CD workflows
|
||||
github-token: ${{ secrets.BITNAMI_BOT_TOKEN }}
|
||||
script: |
|
||||
github.rest.pulls.merge({
|
||||
pull_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
merge_method: 'squash'
|
||||
})
|
||||
# If the CI did not succeed ('VIB Verify' failed or skipped),
|
||||
# post a comment on the PR and assign a maintainer agent to review it
|
||||
- name: Manual review required
|
||||
if: ${{ needs.verification-summary.outputs.result != 'success' }}
|
||||
if: ${{ always() && (needs.verification-summary.outputs.result != 'success' || steps.merge.outcome != 'success') }}
|
||||
uses: peter-evans/create-or-update-comment@v2.0.0
|
||||
with:
|
||||
issue-number: ${{ github.event.number }}
|
||||
|
||||
Reference in New Issue
Block a user