main
ブランチの commit が進んだら、foo/main
への PR を作る job。
GitHub CLI 使って簡単に書ける。
on:
push:
branches:
- main
jobs:
create_release_merge_PR:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
# See: https://github.com/cli/cli/blob/trunk/docs/install_linux.md
- name: install GitHub CLI
run: |-
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install gh
# See: https://cli.github.com/manual/gh_auth_login
# See: https://cli.github.com/manual/gh_pr_create
- name: create RELEASE MERGE PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
git checkout -b release_merge_for_foo
git push --force origin release_merge_for_foo
echo $GITHUB_TOKEN > token.txt
gh auth login --with-token < token.txt
gh pr create \
--title "RELEASE MERGE for foo" \
--base xxx \
--body "Auto Generated RELEASE MEREGE PR"