feat(.github/workflows): streamline dependabot auto-merge workflow
The Dependabot auto-merge workflow has been simplified and focused on essential functionality. Approval steps have been removed, leaving only the core auto-merge capability for minor and patch updates. **New Features** - Added explicit conditional filtering to run jobs **only for Dependabot PRs** **Enhancements & Refinements** - Renamed workflow from **Dependabot Auto-Approve and Auto-Merge** to **Dependabot Auto-Merge** to reflect simplified scope - Improved workflow structure with clearer YAML syntax separation - Reorganized **Fetch Dependabot metadata** step placement for better readability - Removed redundant GitHub script approval step to reduce complexity
This commit is contained in:
1 file changed
+8
-16
@@ -1,5 +1,7 @@
|
|||||||
name: Dependabot Auto-Approve and Auto-Merge
|
name: Dependabot Auto-Merge
|
||||||
on: pull_request
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -7,25 +9,15 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
dependabot:
|
dependabot:
|
||||||
|
# Run only for Dependabot PRs
|
||||||
if: github.actor == 'dependabot[bot]'
|
if: github.actor == 'dependabot[bot]'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Dependabot metadata
|
- name: Fetch Dependabot metadata
|
||||||
id: metadata
|
id: metadata
|
||||||
uses: dependabot/fetch-metadata@v2
|
uses: dependabot/fetch-metadata@v2
|
||||||
- name: Approve PR
|
|
||||||
if: |
|
|
||||||
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
|
|
||||||
steps.metadata.outputs.update-type == 'version-update:semver-patch'
|
|
||||||
uses: actions/github-script@v8
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
await github.rest.pulls.createReview({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: context.payload.pull_request.number,
|
|
||||||
event: 'APPROVE'
|
|
||||||
})
|
|
||||||
- name: Enable auto-merge (squash)
|
- name: Enable auto-merge (squash)
|
||||||
if: |
|
if: |
|
||||||
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
|
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
|
||||||
|
|||||||
Reference in new issue
Block a user