Skip to content

chore(deps): bump actions/github-script from 8 to 9 #3

chore(deps): bump actions/github-script from 8 to 9

chore(deps): bump actions/github-script from 8 to 9 #3

Workflow file for this run

name: Auto-merge Dependabot PRs
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
permissions:
contents: write
pull-requests: write
jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Get PR info
id: pr
uses: actions/github-script@v9
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
// Auto-merge patch and minor updates
const title = pr.data.title.toLowerCase();
const isMinorOrPatch = title.includes('patch') ||
title.includes('minor') ||
title.match(/bump .+ from [\d]+\.[\d]+\.[\d]+ to [\d]+\.[\d]+\.[\d]+$/);
console.log('PR Title:', title);
console.log('Should merge:', isMinorOrPatch);
return { shouldMerge: isMinorOrPatch };
- name: Auto-approve Dependabot PR
if: fromJSON(steps.pr.outputs.result).shouldMerge
run: |
gh pr review ${{ github.event.pull_request.number }} --approve --body "Auto-approving dependency update"
gh pr merge ${{ github.event.pull_request.number }} --squash --auto
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on failure
if: failure()
uses: actions/github-script@v9
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🤖 Auto-merge failed. Please check the CI status and merge manually if appropriate.'
});