Skip to content

Commit

Permalink
CLP-0000: update type input for automerge dependabot workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ingvaar committed Oct 14, 2024
1 parent a50e80f commit 3855460
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/template_automerge_dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ on:
default: "squash"
required: false
type: string
update-types:
description: "Types of version update to allow (possible values are: minor, major, patch)"
default: "patch,minor"
required: false
type: string
include-pre-release:
description: "Include pre-release updates"
default: false
required: false
type: boolean
secrets:
app_id:
required: true
Expand Down Expand Up @@ -42,9 +52,24 @@ jobs:

- name: Enable auto-merge for Dependabot PRs
if: >-
(steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor') &&
!startsWith(steps.metadata.outputs.previous-version, '0.')
(
inputs.include-pre-release ||
!startsWith(steps.metadata.outputs.previous-version, '0.')
) &&
(
(
contains(inputs.update-types, 'major') &&
steps.metadata.outputs.update-type == 'version-update:semver-major'
) ||
(
contains(inputs.update-types, 'minor') &&
steps.metadata.outputs.update-type == 'version-update:semver-minor'
) ||
(
contains(inputs.update-types, 'patch') &&
steps.metadata.outputs.update-type == 'version-update:semver-patch'
)
)
run: |
gh pr review --approve "$PR_URL"
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ jobs:
force: true
# optional: choose strategy when merging (default: squash)
strategy: rebase, merge
# optional: choose which types of update you want to allow (default: minor,patch)
update-types: major,minor,patch
# optional: choose if you want to allow versions with semver 0.X.X (default: false)
include-pre-release: true
secrets:
# identifier of the GitHub App for authentication
app_id: ${{ <your-app-id> }}
Expand Down

0 comments on commit 3855460

Please sign in to comment.