Skip to content

try-merge

try-merge #73

Workflow file for this run

name: Validate and merge PR
on:
repository_dispatch:
types: [try-merge]
jobs:
do_merge:
runs-on: ubuntu-20.04
environment: mergebot
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.MERGEBOT_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
architecture: x64
cache: 'pip'
- run: pip install pyyaml
- name: Setup committer id
run: |
git config --global user.email "[email protected]"
git config --global user.name "PyTorch MergeBot"
- name: Merge PR
env:
GITHUB_TOKEN: ${{ secrets.MERGEBOT_TOKEN }}
PR_NUM: ${{ github.event.client_payload.pr_num }}
FOOBAR: ${{ github.event.client_payload.foobar }}
MESSAGE_ID: ${{ github.event.client_payload.message_id }}
FORCE: ${{ github.event.client_payload.force}}
GH_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
if [ -n "${FORCE}"; then
python3 .github/scripts/trymerge.py --force "${PR_NUM}"
else
python3 .github/scripts/trymerge.py "${PR_NUM}"
fi