diff --git a/.github/workflows/sync-subnet-evm-branch.yml b/.github/workflows/sync-subnet-evm-branch.yml index d51be8df89..c330ce5781 100644 --- a/.github/workflows/sync-subnet-evm-branch.yml +++ b/.github/workflows/sync-subnet-evm-branch.yml @@ -5,7 +5,7 @@ on: remoteBranch: description: "Subnet EVM Branch" required: true - default: "master" + default: "coreth-test-0" jobs: sync_branch: @@ -17,4 +17,49 @@ jobs: - uses: actions/setup-go@v5 with: go-version: "~1.21.12" - check-latest: true \ No newline at end of file + check-latest: true + + - name: Add Remote + run: | + git remote add subnet-evm https://github.com/ava-labs/subnet-evm + + # TODO: Replace test branch with actual (eg, coreth) + - name: Fetch Remote Branch (${{ github.event.inputs.remoteBranch }}) + id: fetch_remote_branch + run: | + git fetch subnet-evm ${{ github.event.inputs.remoteBranch }} + git fetch subnet-evm coreth-diff-script + result=$(git rev-parse --short=8 subnet-evm/${{ github.event.inputs.remoteBranch }}) + echo result="${result}" >> "${GITHUB_OUTPUT}" + + # TODO: Remove this step when the script is checked in + - name: Checkout script + run: | + git checkout subnet-evm/coreth-diff-script -- ./scripts/apply_diff_and_rename.sh + + - name: Apply diff + run: | + ./scripts/apply_diff_and_rename.sh subnet-evm/${{ github.event.inputs.remoteBranch }} + + # TODO: Should this step be removed? + - name: Restore .github/workflows + run: | + git checkout -- .github/workflows + + # TODO: Using a single branch to iterate for now (avoid maing noise in notifications) + - name: Create Pull Request + id: create_pr + uses: peter-evans/create-pull-request@v6 + with: + commit-message: "Sync subnet-evm to ${{ steps.fetch_remote_branch.outputs.result }}" + branch: auto-sync-subnet-evm + title: "Sync Subnet EVM to ${{ steps.fetch_remote_branch.outputs.result }}" + body: | + This PR was created automatically by a GitHub Action. + draft: true + + - name: PR Outputs + if: ${{ steps.create_pr.outputs.pull-request-number }} + run: | + echo "Pull Request Number - ${{ steps.create_pr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.create_pr.outputs.pull-request-url }}"