Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devops/bugfix,refactor/#231 #544 release pr 오류 해결 및 규칙 변경 #545

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
feature: "*/feature/*"
bug: "*/bugfix/*"
refactor: "*/refactor/*"
BE: "Be/*"
FE: "Fe/*"
feature: "*feature*"
bug: ["*bugfix*", "*hotfix*"]
refactor: "*refactor*"
release: "release*"
BE: ["Be/*", "Fe,be/*", "Be,fe/*"]
FE: ["Fe/*", "Fe,be/*", "Be,fe/*"]
DevOps: "Devops/*"
2 changes: 1 addition & 1 deletion .github/workflows/blue-green-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Blue/Green CD for Backend
on:
push:
paths: ["backend/**"]
branches: ["dev"]
branches: ["release", "*hotfix*"]

env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
close-issue:
name: Close Issue
if: github.event.pull_request.base.ref != 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,26 @@ name: Configure PR When PR Opened

on:
pull_request:
types:
- opened
types: ["opened", "edited"]

permissions:
contents: read

jobs:
check-title:
name: Check PR Title
runs-on: ubuntu-latest

steps:
- name: Check PR title
uses: deepakputhraya/action-pr-title@master
with:
regex: '((Be|Fe|Devops|Be,fe|Fe,be)\/(feature|bugfix|hotfix|refactor)(,(feature|bugfix|hotfix|refactor))*\/#[\d]+( #[\d]+)*.+|release v[\d]+\.[\d]+\.[\d]+)'
github_token: ${{ secrets.ADD_TO_PROJECT_PAT }}

set-label:
name: Set Labels to PR
needs: check-title
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -24,23 +35,25 @@ jobs:

set-issue:
name: Set Issue to PR
needs: check-title
runs-on: ubuntu-latest

steps:
- uses: actions/github-script@v7
if: github.event.pull_request.base.ref != 'release'
with:
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
script: |
const prTitle = context.payload.pull_request.title;
const issueNumbers = prTitle.match(/#(\d+)/g);
const prefix = issueNumbers ? issueNumbers.reduce((acc, curr) => `${acc} ${curr}`, "resolved") : '';
const body = context.payload.pull_request.body.replace(/🔮 resolved #(\d+)( #(\d+))*/g, '');
const prefix = issueNumbers ? issueNumbers.reduce((acc, curr) => `${acc}🔮 resolved ${curr}\n`, "") : '';
const body = context.payload.pull_request.body.replace(/(🔮 resolved #\d+)+/g, '');

github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.number,
body: `🔮 ${prefix}\n${body}`,
body: `${prefix}${body}`,
});

issueNumbers?.forEach((num) => {
Expand All @@ -58,6 +71,7 @@ jobs:

steps:
- uses: actions/github-script@v7
if: github.event.pull_request.base.ref != 'release'
with:
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
script: |
Expand Down