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

テスト #325

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
48 changes: 31 additions & 17 deletions .github/workflows/auto-change-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,43 @@ jobs:
infra:
- 'docker-compose.*'
- '**/*Dockerfile'

# ブランチ名からラベル名を取得
- uses: actions/github-script@v6
id: label_name
with:
github-token: ${{ env.GH_TOKEN }}
script: |
const env = process.env;
const branchType = env.PR_BRANCH.split('/')[0]
const branchTypeToLabel = {
feature: 'enhancement',
fix: 'bug',
hotfix: 'bug',
};
core.setOutput('label_name', branchTypeToLabel[branchType] || '')
src:
- 'src/components/common/**'
- 'src/gql/**'
- 'src/pages/**'
- 'src/styles/**'
- 'src/type/**'

# PRにラベルを付与
- name: Auto frontend labeling
if: steps.changes.outputs.frontend == 'true'
run: gh pr edit ${{ env.PR_NUMBER }} --add-label frontend
run: |
if [[ "${{ steps.changes.outputs.frontend }}" == *"view-user/"* ]]; then
gh pr edit ${{ env.PR_NUMBER }} --add-label "frontend-user"
elif [[ "${{ steps.changes.outputs.frontend }}" == *"view-admin/"* ]]; then
gh pr edit ${{ env.PR_NUMBER }} --add-label "frontend-admin"
fi
- name: Auto backend labeling
if: steps.changes.outputs.backend == 'true'
run: gh pr edit ${{ env.PR_NUMBER }} --add-label backend
run: |
if [[ "${{ steps.changes.outputs.backend }}" == *"hasura/"* ]]; then
gh pr edit ${{ env.PR_NUMBER }} --add-label "backend-hasura"
fi
- name: Auto src component common labeling
if: steps.changes.outputs.src == 'true' && "${{ steps.changes.outputs.src }}" == *"src/components/"*
run: gh pr edit ${{ env.PR_NUMBER }} --add-label "component"
- name: Auto src gql labeling
if: steps.changes.outputs.src == 'true' && "${{ steps.changes.outputs.src }}" == *"src/gql/"*
run: gh pr edit ${{ env.PR_NUMBER }} --add-label "gql"
- name: Auto src pages labeling
if: steps.changes.outputs.src == 'true' && "${{ steps.changes.outputs.src }}" == *"src/pages/"*
run: gh pr edit ${{ env.PR_NUMBER }} --add-label "pages"
- name: Auto src styles labeling
if: steps.changes.outputs.src == 'true' && "${{ steps.changes.outputs.src }}" == *"src/styles/"*
run: gh pr edit ${{ env.PR_NUMBER }} --add-label "styles"
- name: Auto src type labeling
if: steps.changes.outputs.src == 'true' && ("${{ steps.changes.outputs.src }}" == *"src/type/" || "${{ steps.changes.outputs.src }}" == *"src/types/" ) && "${{ steps.changes.outputs.src }}" != *"view-user/"*
run: gh pr edit ${{ env.PR_NUMBER }} --add-label "type"
- name: Auto infra labeling
if: steps.changes.outputs.infra == 'true'
run: gh pr edit ${{ env.PR_NUMBER }} --add-label infra
Expand Down
Loading