diff --git a/.github/workflows/sync-pr-to-notion.yml b/.github/workflows/sync-pr-to-notion.yml index 50f4624..a66bfd0 100644 --- a/.github/workflows/sync-pr-to-notion.yml +++ b/.github/workflows/sync-pr-to-notion.yml @@ -1,21 +1,12 @@ name: Sync PR to Notion on: - # 다른 레포에서 호출하는 로직 - # workflow_call: - # secrets: - # NOTION_TOKEN: - # required: true - # NOTION_DATABASE_ID: - # required: true - # NOTION_PROP_ID: - # required: true - # NOTION_PROP_STATUS: - # required: true - # NOTION_PROP_PR: - # required: true - pull_request: - types: [opened, reopened, synchronize, closed] + workflow_call: + secrets: + NOTION_TOKEN: + required: true + NOTION_DATABASE_ID: + required: true jobs: sync-notion: diff --git a/README.md b/README.md index de657e3..f0ff9ac 100644 --- a/README.md +++ b/README.md @@ -16,32 +16,43 @@ ## 설정 안내 -### 1. Notion 설정 -- **기본키 속성** - - 속성 이름: `ID` (식별용 기본키로 반드시 `ID`여야 합니다) - ![기본키](assets/id.png) +### 1. 대상 레포지토리 설정 +- 본 기능을 사용할 레포지토리에서 아래의 설정코드를 추가합니다. -- **GitHub 링크 연결용 속성** - - 속성 타입: `url` - - 속성 이름: `GitHub Pull Requests` - ![GitHub Pull Requests 속성 예시](assets/github_pr.png) +``` +# .github/workflows/call-notion-sync.yml (사용하는 쪽 레포) +name: Call Notion Sync + +on: + pull_request: + types: [opened, reopened, synchronize, closed] + +jobs: + call-notion-sync: + uses: Beyond-Imagination/github-actions/.github/workflows/sync-notion.yml@main + secrets: + NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} + NOTION_DATABASE_ID: ${{ secrets.NOTION_DATABASE_ID }} +``` --- ### 2. GitHub Secret 설정 -- Notion 데이터베이스 아이디를 레포지토리 시크릿 키로 등록합니다. -- GitHub 시크릿 키 이름: `NOTION_DATABASE_ID` -- 예시 URL: - -``` -https://www.notion.so/example/example-227402b843138042a10ec85b1ec04aaf -``` +- 레포지토리 시크릿 키에 `NOTION_DATABASE_ID` 추가 +- NOTION DATABASE ID 추출 방법 : `https://www.notion.so/example/example-227402b843138042a10ec85b1ec04aaf` → 이 중 227402b843138042a10ec85b1ec04aaf 가 데이터베이스 아이디입니다. +### 에러 시 확인할 부분 +- **기본키 속성** + - 속성 이름: `ID` (식별용 기본키로 반드시 `ID`여야 합니다) + ![기본키](assets/id.png) +- **GitHub 링크 연결용 속성** + - 속성 타입: `url` + - 속성 이름: `GitHub Pull Requests` + ![GitHub Pull Requests 속성 예시](assets/github_pr.png) -### 에러 시 확인할 부분 - 생성일시가 `생성 일시` 인지 확인 - `상태` 속성이 맞는지 확인, `진행 중` 속성, `완료` 속성이 있는지 확인 - 그 외 본 레포지토리의 scripts/sync-notion.ts 코드를 확인해 코드와 다르게 설정한 부분이 있는지 확인 \ No newline at end of file