Skip to content

Commit

Permalink
ci(auto-merge): update conditional exprs
Browse files Browse the repository at this point in the history
Signed-off-by: Dwi Siswanto <[email protected]>
  • Loading branch information
dwisiswant0 committed Mar 21, 2024
1 parent c8a7497 commit 49abb91
Showing 1 changed file with 31 additions and 7 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/auto-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,61 @@ on:
types: [submitted]
workflow_call:

permissions:
contents: write
pull-requests: write

jobs:
auto-merge:
runs-on: ubuntu-latest
steps:
- name: Is PR ready?
id: is-ready
if: >
(
(
!github.event.pull_request.draft &&
github.event.pull_request.mergeable
) ||
contains(github.event.pull_request.labels.*.name, 'ready')
)
run: true

- name: Is Dependabot?
id: is-dependabot
if: github.event.pull_request.user.login == 'dependabot[bot]'
run: true

- name: Is patch update?
id: patch-update
if: >
success() && contains(
steps.is-dependabot.outcome == 'success' && contains(
github.event.head_commit.message, 'version-update:semver-patch'
)
run: true

- name: Auto merge PR
if: >
(success() && !github.event.pull_request.draft) ||
github.event.pull_request.mergeable
(
steps.is-ready.outcome == 'success' ||
steps.is-dependabot.outcome == 'success'
)
uses: pascalgn/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: "ready"
MERGE_REMOVE_LABELS: "ready"
MERGE_LABELS: ""
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "automatic"
MERGE_FILTER_AUTHOR: "dependabot[bot]"
MERGE_FORKS: "false"
MERGE_FORKS: "true"
MERGE_RETRIES: "6"
MERGE_RETRY_SLEEP: "10000"
MERGE_REQUIRED_APPROVALS: "${{ steps.patch-update.outcome == 'success' && 0 || 1 }}"
MERGE_REQUIRED_APPROVALS: "${{
(
steps.is-ready.outcome == 'success' ||
steps.patch-update.outcome == 'success'
) &&
0 || 1
}}"
UPDATE_LABELS: ""
UPDATE_METHOD: "rebase"

0 comments on commit 49abb91

Please sign in to comment.