Open new PR #10
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: Open new PR | |
on: | |
workflow_dispatch: | |
inputs: | |
pr_name: | |
description: Name of the PR to be opened | |
required: true | |
type: string | |
jobs: | |
update-version: | |
defaults: | |
run: | |
shell: bash -l {0} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: configure git | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
- name: Open new PR | |
env: | |
PR_NAME: ${{ inputs.pr_name }} | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
set -eo pipefail | |
touch $PR_NAME | |
git checkout -b $PR_NAME | |
git add $PR_NAME | |
git commit -m "add $PR_NAME" | |
git push origin $PR_NAME -f | |
gh pr create --base main --body "auto PR" --title $PR_NAME |