Skip to content

Commit

Permalink
Merge pull request #11 from SaKu2110/feat/git-pr-release
Browse files Browse the repository at this point in the history
feat: git pr release
  • Loading branch information
SaKu2110 authored Oct 9, 2023
2 parents 3820ac2 + 7f463b4 commit f705d13
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/pr-release.tmpl.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<% sorted_pr = pull_requests.sort_by {|pr| pr.pr.merged_at} -%>
Request deployment <%= Time.now.strftime("%Y-%m-%d") %>
<% sorted_pr.each do |pr| -%>
<%= "- ##{pr.pr.number} @#{pr.pr.user.login}" %>
<% end -%>
26 changes: 26 additions & 0 deletions .github/workflows/git-pr-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ref: https://github.com/x-motemen/git-pr-release
name: git-pr-release
on:
push:
branches:
- develop
jobs:
create_pr:
runs-on: ubuntu-latest
env:
GIT_PR_RELEASE_BRANCH_PRODUCTION: master
GIT_PR_RELEASE_BRANCH_STAGING: develop
steps:
- uses: actions/checkout@v1
- name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
- name: Execute git-pr-release
env:
GIT_PR_RELEASE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_PR_RELEASE_TEMPLATE: ".github/pr-release.tmpl.erb"
run: |
gem install --no-document git-pr-release -v "2.2.0"
git remote set-url origin "https://${GITHUB_ACTOR}:${GIT_PR_RELEASE_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git-pr-release

0 comments on commit f705d13

Please sign in to comment.