mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-22 19:52:18 -05:00
37 lines
1.0 KiB
YAML
37 lines
1.0 KiB
YAML
name: auto-merge
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
permissions:
|
|
pull-requests: write
|
|
contents: write
|
|
|
|
jobs:
|
|
dependabot:
|
|
if: github.event.pull_request.user.login == 'dependabot[bot]'
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Dependabot metadata
|
|
id: meta
|
|
uses: dependabot/fetch-metadata@v2
|
|
with:
|
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
- name: Check if auto-merge applicable
|
|
id: check
|
|
run: |
|
|
if [[ "${{ steps.meta.outputs.update-type }}" == "version-update:semver-patch" ]] || \
|
|
[[ "${{ steps.meta.outputs.update-type }}" == "version-update:semver-minor" ]]; then
|
|
echo "should_merge=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "should_merge=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Enable auto-merge
|
|
if: steps.check.outputs.should_merge == 'true'
|
|
run: gh pr merge --auto --merge "$PR_URL"
|
|
env:
|
|
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|