automerge #31959
This file contains 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: automerge | |
on: | |
pull_request: | |
types: | |
- labeled | |
check_suite: | |
types: | |
- completed | |
status: {} | |
jobs: | |
auto-approve: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
if: github.event.label.name == 'automerge' && github.event.sender.login == 'broadbot' | |
steps: | |
- uses: "hmarr/auto-approve-action@v3" | |
with: | |
review-message: "This PR was automatically approved" | |
automerge: | |
runs-on: ubuntu-latest | |
needs: auto-approve | |
steps: | |
- name: automerge | |
uses: "broadinstitute/[email protected]" | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
MERGE_METHOD: squash | |
MERGE_FORKS: false | |
MERGE_RETRIES: 180 # Retry for 3 hours | |
MERGE_RETRY_SLEEP: 60000 # 60 seconds | |
UPDATE_METHOD: rebase | |
UPDATE_RETRIES: 180 # Retry for 3 hours | |
UPDATE_RETRY_SLEEP: 60000 # 60 seconds | |
MERGE_REQUIRED_APPROVALS: 0 | |
MERGE_ERROR_FAIL: true | |
init-github-context: | |
runs-on: ubuntu-latest | |
needs: auto-approve | |
outputs: | |
notify-failure-channel: ${{ steps.prepare-outputs.outputs.notify-failure-channel }} | |
steps: | |
- name: Match the PR to the corresponding team's slack notification channel | |
id: prepare-outputs | |
run: | | |
if ${{ contains(github.event.pull_request.title, 'AN-') }}; then | |
echo 'notify-failure-channel=dsp-analysis-non-prod-alerts' >> $GITHUB_OUTPUT | |
else ${{ contains(github.event.pull_request.title, 'CORE-') }}; | |
echo 'notify-failure-channel=dsp-core-services' >> $GITHUB_OUTPUT | |
fi | |
report-workflow: | |
uses: broadinstitute/sherlock/.github/workflows/client-report-workflow.yaml@main | |
needs: [ automerge, init-github-context ] | |
with: | |
notify-slack-channels-upon-workflow-failure: ${{ needs.init-github-context.outputs.notify-failure-channel }} | |
permissions: | |
id-token: 'write' | |