Skip to content

chore: add debug workflow #4

chore: add debug workflow

chore: add debug workflow #4

name: Create PR to Main on release

Check failure on line 1 in .github/workflows/create-pr-to-main.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create-pr-to-main.yml

Invalid workflow file

Invalid `steps` value - steps should be list of `uses` or `run` items
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 }}