Skip to content

Merge External PR: Merge main-pr429 into main #153

Merge External PR: Merge main-pr429 into main

Merge External PR: Merge main-pr429 into main #153

Workflow file for this run

name: Final merge to main
on:
pull_request_target:
types:
- closed
permissions:
contents: read
jobs:
add-trailers-and-merge:
if: |
github.event.pull_request.merged == true &&
startsWith(github.event.pull_request.base.ref, 'main-pr')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Set up Git
run: |
git config --global user.name "urunc-bot[bot]"
git config --global user.email "urunc-bot[bot]@users.noreply.github.com"
- name: Check out repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.base.ref }}
- name: Generate urunc-bot token
id: generate-token
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
with:
app-id: ${{ vars.URUNC_BOT_APP_ID }}
private-key: ${{ secrets.URUNC_BOT_PRIVATE_KEY }}
- name: Append git trailers
uses: nubificus/git-trailers@18fd322f3fbfd505b4de728974a4ac1f32f758a7 # feat_auto_merge
with:
user_info: .github/contributors.yaml
- name: Create a Pull Request from PR_BRANCH to main and merge it
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
PR_BRANCH=${{ github.event.pull_request.base.ref }}
# Create the pull request
PR_URL=$(gh pr create \
--head "$PR_BRANCH" \
--base main \
--title "Merge External PR: Merge $PR_BRANCH into main" \
--body "This PR was automatically created by GitHub Actions to merge changes from $PR_BRANCH into main.")
gh pr merge "$PR_URL" --rebase --admin --delete-branch