diff --git a/.github/workflows/template_automerge_dependabot.yml b/.github/workflows/template_automerge_dependabot.yml index 10d5d78..f3634ee 100644 --- a/.github/workflows/template_automerge_dependabot.yml +++ b/.github/workflows/template_automerge_dependabot.yml @@ -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 @@ -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" diff --git a/README.md b/README.md index 989e896..ba8dcb3 100644 --- a/README.md +++ b/README.md @@ -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: ${{ }}