Skip to content

Commit

Permalink
chore: PR close 시 merged 라벨 추가 및 기존 워크플로 픽스 (#43)
Browse files Browse the repository at this point in the history
* chore: 워크플로 이름 수정

* refactor: 파일명 변경

* chore: PR이 closed 될 때 merged 라벨 추가하는 워크플로 작성

* chore: 테스트용 트리거 추가

* chore: 권한 설정 변경

* chore: 테스트 트리거 재설정

* chore: 테스트 트리거 롤백

* chore: 프로젝트 워크플로 테스트 트리거 활성화

* �chore: 코드 정적 분석 SonarCloud 설정 (#38)

* �chore: 코드 정적 분석 SonarCloud 설정 (#38)

* chore: pending 워크플로우의 쿼리 수정

* fix: pending 상태 id 값 직접 삽입

* fix: 쿼리 전 인자값을 미리 선언하도록 지정

* chore: 테스트 트리거 롤백

* chore: 잡 이름 변경

* chore: 워크플로 이름 변경

---------

Co-authored-by: yb__char <[email protected]>
Co-authored-by: ybchar <[email protected]>
  • Loading branch information
3 people committed Dec 6, 2023
1 parent a7ed2a4 commit acd8d64
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 20 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/issue_set_merged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Add 'merged' label to closed PR

on:
pull_request:
types:
- closed

jobs:
set_merged:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Add 'merged' label to closed PR
run: gh issue edit "$PR_NUMBER" --add-label "merged"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Add PR to project as pending status
name: Add New PR to project as pending status

on:
pull_request:
types:
- opened

jobs:
track_pr:
set_pending:
runs-on: ubuntu-latest
steps:
# Github App을 사용하여 토큰 생성
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_APP_PEM }}
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_APP_PEM }}

# Github CLI를 사용하여 프로젝트 ID 및 필드 정보를 조회 후 project_data.json 파일에 저장
- name: Get project data
Expand Down Expand Up @@ -79,23 +79,20 @@ jobs:
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
PENDING_OPTION_ID="${{ env.PENDING_OPTION_ID }}"
gh api graphql -f query='
mutation (
$project: ID!
$item: ID!
$status_field: ID!
$status_value: String!
) {
set_status: updateProjectV2ItemFieldValue(input: {
projectId: $project
itemId: $item
fieldId: $status_field
value: {
singleSelectOptionId: $status_value
}
}) {
mutation ($project: ID!, $item: ID!, $status_field: ID!, $status_value: String!) {
updateProjectV2ItemFieldValue(
input: {
projectId: $project,
itemId: $item,
fieldId: $status_field,
value: {singleSelectOptionId: $status_value}
}
) {
projectV2Item {
id
}
}
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=$PENDING_OPTION_ID --silent
}
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=$PENDING_OPTION_ID --silent

0 comments on commit acd8d64

Please sign in to comment.