mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-05 20:42:54 +00:00
## Problem https://github.com/neondatabase/neon/actions/runs/14538136318/job/40790985693?pr=11645 failed, even though the relevant parts of the CI had passed and auto-merge determined the PR is ready to merge. After that, commenting failed. ## Summary of changes - set GH_TOKEN for commenting after fast-forward failure - allow merging with mergeable_state unstable
44 lines
1.6 KiB
YAML
44 lines
1.6 KiB
YAML
name: Fast forward merge
|
|
on:
|
|
pull_request:
|
|
types: [labeled]
|
|
branches:
|
|
- release
|
|
- release-proxy
|
|
- release-compute
|
|
|
|
jobs:
|
|
fast-forward:
|
|
if: ${{ github.event.label.name == 'fast-forward' }}
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Harden the runner (Audit all outbound calls)
|
|
uses: step-security/harden-runner@v2
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Remove fast-forward label to PR
|
|
env:
|
|
GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
|
|
run: |
|
|
gh pr edit ${{ github.event.pull_request.number }} --repo "${GITHUB_REPOSITORY}" --remove-label "fast-forward"
|
|
|
|
- name: Fast forwarding
|
|
uses: sequoia-pgp/fast-forward@ea7628bedcb0b0b96e94383ada458d812fca4979
|
|
# See https://docs.github.com/en/graphql/reference/enums#mergestatestatus
|
|
if: ${{ contains(fromJSON('["clean", "unstable"]'), github.event.pull_request.mergeable_state) }}
|
|
with:
|
|
merge: true
|
|
comment: on-error
|
|
github_token: ${{ secrets.CI_ACCESS_TOKEN }}
|
|
|
|
- name: Comment if mergeable_state is not clean
|
|
if: ${{ !contains(fromJSON('["clean", "unstable"]'), github.event.pull_request.mergeable_state) }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
|
|
run: |
|
|
gh pr comment ${{ github.event.pull_request.number }} \
|
|
--repo "${GITHUB_REPOSITORY}" \
|
|
--body "Not trying to forward pull-request, because \`mergeable_state\` is \`${{ github.event.pull_request.mergeable_state }}\`, not \`clean\` or \`unstable\`."
|