Skip to content

Commit

Permalink
feat: add shared PR actions
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUnderScorer committed Nov 28, 2023
1 parent 7bb3529 commit 684dcac
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/create-pr-to-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Create PR to Main on release

on:
workflow_call:
inputs:
repository:
required: true
type: string
tag_name:
required: true
type: string
prerelease:
required: true
type: boolean
secrets:
GITHUB_TOKEN:
required: true

jobs:
create-pr-to-main-on-release:
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 ${{ inputs.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/sync-test-with-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Sync test with main

on:
workflow_call:
inputs:
repository:
required: true
type: string
secrets:
GITHUB_TOKEN:
required: true

jobs:
sync-test-with-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 test with main" --base test --head main --repo ${{ inputs.repository }} --label "sync"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 684dcac

Please sign in to comment.