-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: deploy action setting 수정 (#54)
* fix: nginx.conf 주석 스타일 변경 CHZZ-105 * docs: Pull Request Template 수정 CHZZ-105 * chore: P6spy prod 비활성화 CHZZ-105 * chore: deploy action 최적화 CHZZ-105 * chore: PR title, branch name 검사하는 action 추가 CHZZ-105 * chore: 배포시 브랜치에서 버전 정보를 가져오는 것으로 수정 CHZZ-105 * chore: 배포시 릴리즈 태그와 노트를 자동화하는 설정 추가 CHZZ-105 * refactor: 브랜치 이름에서 버전 추출하는 로직 수정 CHZZ-105 * chore: main에 머지될때 자동으로 태그와 릴리즈 노트를 작성하는 설정 추가 CHZZ-105 * chore: PR 제목 검사하는 action 수정 CHZZ-105 * chore: PR types에 synchronize 추가 CHZZ-105
- Loading branch information
Showing
7 changed files
with
161 additions
and
49 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: PR Title and Branch Name Validation | ||
|
||
on: | ||
pull_request: | ||
types: [ opened, edited, reopened, synchronize] | ||
branches: | ||
- main | ||
- develop | ||
- release/* | ||
- hotfix/* | ||
|
||
jobs: | ||
validate-title-and-branch: | ||
runs-on: ubuntu-latest | ||
if: ${{ !(github.head_ref == 'main' && github.base_ref == 'develop') }} # main -> develop일 때는 실행하지 않음 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Validate PR Title | ||
uses: Slashgear/[email protected] | ||
with: | ||
regexp: '^(feat|fix|docs|refactor|style|test|chore|design|move):\s.+$|^(release|hotfix):\s\d+\.\d+\.\d+$' | ||
helpMessage: | | ||
❌ PR 제목이 규칙을 따르지 않습니다. | ||
제목은 다음 형식 중 하나여야 합니다: | ||
- `<type>: <description>` (Allowed types: feat, fix, docs, refactor, style, test, chore, design, move) | ||
- `release: x.x.x` (Semantic Versioning format) | ||
- `hotfix: x.x.x` (Semantic Versioning format) | ||
- name: Validate Branch Name | ||
run: | | ||
BRANCH_NAME="${{ github.head_ref }}" | ||
# PR 브랜치 이름 검사 | ||
if [[ "$BRANCH_NAME" =~ ^(feat|fix|docs|refactor|style|test|chore|design|move)/.+$ ]]; then | ||
echo "✅ Branch name follows the feature branch convention!" | ||
elif [[ "$BRANCH_NAME" =~ ^(release|hotfix)/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "✅ Branch name follows the release or hotfix versioning convention!" | ||
else | ||
echo "❌ Branch name does not follow the conventional pattern." | ||
echo "Ensure your branch name follows one of these formats:" | ||
echo "- feat/*, fix/*, docs/*, refactor/*, style/*, test/*, chore/*, design/*, move/*" | ||
echo "- release/x.x.x (Semantic Versioning format)" | ||
echo "- hotfix/x.x.x (Semantic Versioning format)" | ||
exit 1 | ||
fi | ||
shell: bash | ||
|
||
- name: PR Title and Branch Validation Success | ||
if: success() | ||
run: echo "✅ PR title and branch name follow the conventions!" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name-template: 'v$RESOLVED_VERSION' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
categories: | ||
- title: '🎁 새로운 기능이 추가되었어요' | ||
label: '✨feature' | ||
- title: '🐞 버그를 수정했어요' | ||
label: '🐛bug' | ||
- title: '🐬 코드를 개선했어요' | ||
label: '🪄refactor' | ||
- title: '⚙️ 설정 파일을 변경했어요' | ||
label: '⚙️chore' | ||
change-template: '- $TITLE #$NUMBER @$AUTHOR ' | ||
template: | | ||
## 이번 버전의 변경사항은 아래와 같아요 | ||
--- | ||
$CHANGES | ||
no-changes-template: '변경사항이 없어요' | ||
version-resolver: | ||
major: | ||
labels: | ||
- '✨ major' | ||
minor: | ||
labels: | ||
- '✨ minor' | ||
patch: | ||
labels: | ||
- '✨ patch' | ||
default: patch |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Create Tag on PR Merge | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- main | ||
jobs: | ||
tag: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create Tag | ||
run: | | ||
BRANCH_NAME="${{ github.event.pull_request.head.ref }}" | ||
# 'release/' 또는 'hotfix/' 접두사를 제거 | ||
TAG_NAME="${BRANCH_NAME#release/}" | ||
TAG_NAME="${TAG_NAME#hotfix/}" | ||
# 태그 이름이 비어있을 경우 처리 | ||
if [ -z "$TAG_NAME" ]; then | ||
echo "Error: TAG_NAME is empty. Please check the branch name." | ||
exit 1 | ||
fi | ||
git tag $TAG_NAME | ||
git push origin $TAG_NAME | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Update Release | ||
uses: release-drafter/release-drafter@v5 | ||
with: | ||
config-name: release-drafter-config.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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