Bump nginx from 1.27.3-bookworm to 1.27.4-bookworm in /nginx #32
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto-Merge Dependabot PRs | |
on: | |
pull_request: | |
types: [opened, reopened, labeled, synchronize] | |
jobs: | |
auto-merge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if PR is eligible for auto-merge | |
id: check | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const prNumber = context.payload.pull_request.number; | |
const { data: pr } = await github.rest.pulls.get({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: prNumber | |
}); | |
// Only proceed if the PR is created by Dependabot. | |
if (pr.user.login !== 'dependabot[bot]') { | |
core.info("PR is not from Dependabot. Skipping auto-merge."); | |
core.setOutput("shouldMerge", "false"); | |
return; | |
} | |
// Check if the PR has the 'automerge' label. | |
const labels = pr.labels.map(label => label.name); | |
if (!labels.includes('automerge')) { | |
core.info("PR does not have the 'automerge' label. Skipping auto-merge."); | |
core.setOutput("shouldMerge", "false"); | |
return; | |
} | |
core.info("Skipping status checks. Proceeding with auto-merge."); | |
core.setOutput("shouldMerge", "true"); | |
- name: Auto-Merge PR | |
if: steps.check.outputs.shouldMerge == 'true' | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const prNumber = context.payload.pull_request.number; | |
const mergeResponse = await github.rest.pulls.merge({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: prNumber, | |
merge_method: "squash" | |
}); | |
core.info(`Merge response: ${JSON.stringify(mergeResponse.data)}`); | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |