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:
sankalp committed 2025-12-17 10:11:25 +05:45
1 parent 7d04ad2f2e
commit d8402927e1
1 file changed
+8 -16
+8 -16
View File
@@ -1,5 +1,7 @@
name: Dependabot Auto-Approve and Auto-Merge
on: pull_request
name: Dependabot Auto-Merge
on:
pull_request:
permissions:
contents: write
@@ -7,25 +9,15 @@ permissions:
jobs:
dependabot:
# Run only for Dependabot PRs
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Dependabot metadata
- name: Fetch Dependabot metadata
id: metadata
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)
if: |
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||