chore: add debug workflow #4
Workflow file for this run
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: Create PR to Main on release | ||
on: | ||
workflow_call: | ||
inputs: | ||
target_branch: | ||
required: true | ||
type: string | ||
description: "Branch to create a pr for" | ||
tag_name: | ||
required: false | ||
type: string | ||
prerelease: | ||
required: false | ||
type: boolean | ||
jobs: | ||
debug: | ||
runs-on: ubuntu-latest | ||
steps: | ||
run: | | ||
echo "target_branch: ${{ inputs.target_branch }}" | ||
echo "tag_name: ${{ inputs.tag_name }}" | ||
echo "prerelease: ${{ inputs.prerelease }}" | ||
create-pr-to-main-on-release: | ||
if: inputs.target_branch == 'main' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Abort if it's not a pre-release | ||
if: inputs.prerelease == false | ||
run: exit 1 | ||
- name: Checkout test branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: 'test' | ||
- name: Create Pull Request from tag branch to main | ||
run: | | ||
gh pr create --title "Release ${{ inputs.tag_name }}" --body "Release ${{ inputs.tag_name }}" --base main --head test --repo ${{ github.repository }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
create-pr-to-sync-with-main: | ||
if: inputs.target_branch != 'main' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout main branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: 'main' | ||
- name: Create Pull Request from main to test | ||
run: | | ||
gh pr create --title "Sync ${{ inputs.target_branch }} with main" --base ${{ inputs.target_branch }} --head main --repo ${{ github.repository }} --label "sync" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |