Skip to content

Instantly share code, notes, and snippets.

@mnaruse
Last active March 31, 2024 10:11
Show Gist options
  • Save mnaruse/e72ed572e801121c373b379f59e176aa to your computer and use it in GitHub Desktop.
Save mnaruse/e72ed572e801121c373b379f59e176aa to your computer and use it in GitHub Desktop.
name: Create a release pull request
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs#defining-access-for-the-github_token-scopes
permissions:
contents: read
pull-requests: write
jobs:
create-release-pr:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # git-pr-release needs the git histories
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3 # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# https://github.com/x-motemen/git-pr-release
- name: Create a release pull request
env:
GIT_PR_RELEASE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_PR_RELEASE_BRANCH_PRODUCTION: main
GIT_PR_RELEASE_BRANCH_STAGING: develop
GIT_PR_RELEASE_LABELS: release
TZ: Asia/Tokyo
run: |
gem install -N git-pr-release -v "2.2.0"
git-pr-release --no-fetch
on:
workflow_dispatch:
push:
branches:
- develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment