chore: Fisherman network deployments #2072
Workflow file for this run
This file contains hidden or 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: Merge-Train Recreate | |
on: | |
pull_request: | |
types: [closed] | |
jobs: | |
recreate: | |
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'merge-train/')) }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} | |
- name: Configure Git | |
run: | | |
git config --global user.name "AztecBot" | |
git config --global user.email "[email protected]" | |
- name: Recreate branch | |
run: | | |
MERGE_TRAIN_BRANCH="${{ github.event.pull_request.head.ref }}" | |
BASE_BRANCH="${{ github.event.pull_request.base.ref }}" | |
git fetch origin "$BASE_BRANCH" | |
git checkout -b "$MERGE_TRAIN_BRANCH" "origin/$BASE_BRANCH" | |
- name: Push branch | |
continue-on-error: true | |
run: | | |
# This will generally only succeed if the branch does not exist, as a fallback if the branch is unprotected and gets deleted. | |
git push origin "$MERGE_TRAIN_BRANCH" | |