Skip to content

Commit 2b66a03

Browse files
committed
ci: remoe sync workflows and create release pr
1 parent 44b610f commit 2b66a03

File tree

2 files changed

+64
-43
lines changed

2 files changed

+64
-43
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Create Release PR
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
create-release-pr:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Generate GitHub App Token
23+
id: generate-token
24+
uses: tibdex/github-app-token@v1
25+
with:
26+
app_id: ${{ secrets.APP_ID }}
27+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
28+
installation_id: ${{ secrets.APP_INSTALLATION_ID }}
29+
30+
- name: Create Release PR Branch
31+
run: |
32+
git config --global user.name "GitHub Actions"
33+
git config --global user.email "[email protected]"
34+
35+
# 현재 날짜와 시간을 포함한 고유한 브랜치 이름 생성
36+
BRANCH_NAME="sync-main-to-release-$(date +'%Y%m%d-%H%M%S')"
37+
git checkout -b $BRANCH_NAME
38+
39+
# GitHub App 토큰을 사용하여 브랜치 푸시
40+
git remote set-url origin https://x-access-token:${{ steps.generate-token.outputs.token }}@github.com/${{ github.repository }}
41+
git push origin $BRANCH_NAME
42+
43+
# 변경 내용 요약
44+
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
45+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
46+
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV
47+
48+
- name: Create Pull Request
49+
uses: peter-evans/create-pull-request@v5
50+
with:
51+
token: ${{ steps.generate-token.outputs.token }}
52+
base: release
53+
branch: ${{ env.BRANCH_NAME }}
54+
title: 'chore: sync main to release'
55+
body: |
56+
이 PR은 메인 브랜치의 변경사항을 릴리즈 브랜치로 동기화합니다.
57+
58+
## 주요 변경사항:
59+
${{ env.COMMIT_MESSAGE }}
60+
61+
이 PR이 머지되면 릴리즈 워크플로우가 자동으로 트리거됩니다.
62+
labels: |
63+
automated-pr
64+
sync-to-release

.github/workflows/sync-vue-pivottable.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)