Automate prow job dispatcher at Fri, 28 Feb 2025 10:32:43 UTC #2
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 dispatcher PRs from openshift-bot | |
on: | |
pull_request: | |
types: [opened, edited, reopened, synchronize] | |
jobs: | |
auto-merge: | |
if: ${{ startsWith(github.event.pull_request.title, 'Automate prow job dispatcher at') && github.event.pull_request.user.login == 'openshift-bot' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Merge PR Even if Checks Fail | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const prNumber = context.payload.pull_request.number; | |
console.log(`Attempting to merge PR #${prNumber}...`); | |
try { | |
const mergeResponse = await github.rest.pulls.merge({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: prNumber, | |
merge_method: "squash" | |
}); | |
console.log('Merge successful:', mergeResponse.data); | |
} catch (error) { | |
console.error('Failed to merge PR:', error); | |
throw error; | |
} |