Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/dependabot-automerge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ on:
default: none
description: |
GitHub Actions upgrades to automatically merge. Valid values are: all, none, major, minor, patch.
gomod:
required: false
type: string
default: none
description: |
Go upgrades to automatically merge. Valid values are: all, none, major, minor, patch.
npm:
required: false
type: string
Expand Down Expand Up @@ -57,6 +63,12 @@ jobs:
exit 1
fi

echo "gomod=${{ inputs.gomod }}"
if [[ ! "${{ inputs.gomod }}" =~ ^(all|none|major|minor|patch)$ ]]; then
echo "Invalid input: gomod=${{ inputs.gomod }}"
exit 1
fi

echo "npm=${{ inputs.npm }}"
if [[ ! "${{ inputs.npm }}" =~ ^(all|none|major|minor|patch)$ ]]; then
echo "Invalid input: npm=${{ inputs.npm }}"
Expand Down Expand Up @@ -130,3 +142,34 @@ jobs:
run: |
gh pr review --approve --body "Merging this \`${UPDATE_TYPE}\` update (npm: \`${MERGE_ECOSYSTEM}\`, all: \`${MERGE_ALL}\`)" "$PR_URL"
gh pr merge --auto --merge "$PR_URL"

- name: Merge Go update
if: |
steps.metadata.outputs.package-ecosystem == 'go_modules' &&
(
(inputs.all == 'all' || inputs.go_modules == 'all') ||
(
steps.metadata.outputs.update-type == 'version-update:semver-major' &&
(inputs.all == 'major' || inputs.go_modules == 'major')
) ||
(
steps.metadata.outputs.update-type == 'version-update:semver-minor' &&
(
(inputs.all == 'major' || inputs.go_modules == 'major') ||
(inputs.all == 'minor' || inputs.go_modules == 'minor')
)
) ||
(
steps.metadata.outputs.update-type == 'version-update:semver-patch' &&
(inputs.all != 'none' || inputs.go_modules != 'none')
)
)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_ALL: ${{ inputs.all }}
MERGE_ECOSYSTEM: ${{ inputs.gomod }}
UPDATE_TYPE: ${{ steps.metadata.outputs.update-type }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
gh pr review --approve --body "Merging this \`${UPDATE_TYPE}\` update (gomod: \`${MERGE_ECOSYSTEM}\`, all: \`${MERGE_ALL}\`)" "$PR_URL"
gh pr merge --auto --merge "$PR_URL"