add sync workflow in test mode #2
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: Sync PRs between Repos | |
on: | |
pull_request: | |
types: | |
- closed | |
- synchronize | |
- reopened | |
branches: | |
- 'master' | |
jobs: | |
sync_pr: | |
# if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Create PR in Repo Subnet-EVM | |
run: | | |
# Get the body of the original PR | |
original_body=$(gh pr view ${GITHUB_REPOSITORY} --json body --jq '.body') | |
gh pr create \ | |
--repo ava-labs/subnet-evm \ | |
--title "${{ github.event.pull_request.title }}" \ | |
--body "This PR was automatically created to sync changes from Coreth.\n\nOriginal PR: ${{ github.event.pull_request.html_url }}\n\n---\n\n${original_body}" \ | |
--base "${{ github.event.pull_request.base.ref }}" \ | |
--head "${{ github.event.pull_request.head.ref }}" \ | |
--assignee "${{ github.event.pull_request.user.login }}" \ | |
--draft=false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |