From 765b68509cc6c52f7dbb3ffc476a5ba021e0ecb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EC=9E=AC=EC=A4=91?= <126754298+m-a-king@users.noreply.github.com> Date: Thu, 15 Oct 2026 15:32:26 +0900 Subject: [PATCH 1/4] =?UTF-8?q?chore:=20ops=20=EC=97=B0=EA=B2=B0=20?= =?UTF-8?q?=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ops-pull 추가 - 사람이 패치 id 와 ops 커밋 sha 를 넣어 실행하면 그 패치로 PR 을 엶 - 검사·CI 승인은 infra 의 ops-pull 액션이 맡음 - 공개 repo 라 URL·금지어가 든 패치도 거부 - 금지어 목록은 시크릿 OPS_DENY_PATTERN 으로 넘김 - 원인: 공개 코드에 단어가 남지 않게 함 - 대안: 매일 예약 실행으로 자동 개시 - 기각: 공개 repo 라 확인 전의 패치가 PR 로 열리는 순간 공개 --- .github/workflows/ops-pull.yml | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/ops-pull.yml diff --git a/.github/workflows/ops-pull.yml b/.github/workflows/ops-pull.yml new file mode 100644 index 0000000..93712d6 --- /dev/null +++ b/.github/workflows/ops-pull.yml @@ -0,0 +1,38 @@ +# 사람이 ops 이슈에서 확인한 패치 하나를 PR 로 연다. 검사·CI 승인 로직은 infra 의 ops-pull 정본. +# 공개 repo 라 정본이 URL·금지어 검사를 켠다. 금지어 목록은 공개 코드에 남지 않게 시크릿으로 둔다. +name: Ops Pull + +on: + workflow_dispatch: + inputs: + id: + description: ops 이슈에 적힌 패치 id (YYYYMMDD-N) + required: true + type: string + ops_commit: + description: ops 이슈에 적힌 커밋 sha (40자). 확인한 그 커밋의 패치만 올린다 + required: true + type: string + +permissions: {} + +concurrency: + group: ops-pull + cancel-in-progress: false + +jobs: + pull: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + actions: write + steps: + - uses: actions/checkout@v4 + + - uses: TeamPiKi/infra/.github/actions/ops-pull@main + with: + id: ${{ inputs.id }} + ops-commit: ${{ inputs.ops_commit }} + ops-deploy-key: ${{ secrets.OPS_DEPLOY_KEY }} + deny-pattern: ${{ secrets.OPS_DENY_PATTERN }} From e64989ecdfee768ba4d4c4083dd286f0f899d97e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EC=9E=AC=EC=A4=91?= <126754298+m-a-king@users.noreply.github.com> Date: Thu, 15 Oct 2026 16:01:14 +0900 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20ops-pull=20=EC=9D=84=20=EC=8A=B9?= =?UTF-8?q?=EC=9D=B8=20=EB=8C=80=EA=B8=B0=20=EC=98=88=EC=95=BD=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=EC=9C=BC=EB=A1=9C=20=EC=A0=84=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 사람이 id·sha 를 넣어 PR 을 열던 실행을 하루 두 번 예약 실행으로 교체 - 원인: id·sha 입력이 번거로움 - scan job 이 새 패치 하나를 찾고 open job 이 environment ops-approval 의 승인을 기다림 - 승인 뒤에만 브랜치와 PR 을 만듦 - 원인: 공개 repo 는 브랜치를 올리는 순간 공개 - open job 이름에 항목을 만든 커밋 sha 40자 - 원인: 사람이 ops 이슈의 sha 와 맞춰 보고 승인 - 승인 대기 중인 실행이 있으면 다음 실행은 뒤에 줄을 섬 --- .github/workflows/ops-pull.yml | 51 ++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ops-pull.yml b/.github/workflows/ops-pull.yml index 93712d6..09d371f 100644 --- a/.github/workflows/ops-pull.yml +++ b/.github/workflows/ops-pull.yml @@ -1,38 +1,61 @@ -# 사람이 ops 이슈에서 확인한 패치 하나를 PR 로 연다. 검사·CI 승인 로직은 infra 의 ops-pull 정본. -# 공개 repo 라 정본이 URL·금지어 검사를 켠다. 금지어 목록은 공개 코드에 남지 않게 시크릿으로 둔다. +# 루틴이 ops 에 남긴 패치를 사람이 승인하면 PR 로 연다. 검사·CI 승인 로직은 infra 의 ops-pull 정본. +# 공개 repo 라 브랜치도 승인 전에는 올리지 않는다. 승인은 environment ops-approval 의 required reviewer. name: Ops Pull on: + # 매일 아침 루틴이 끝난 뒤와 오후 한 번. 루틴 시각은 claude.ai 루틴 설정이 정본 + schedule: + - cron: '47 0,4 * * *' workflow_dispatch: - inputs: - id: - description: ops 이슈에 적힌 패치 id (YYYYMMDD-N) - required: true - type: string - ops_commit: - description: ops 이슈에 적힌 커밋 sha (40자). 확인한 그 커밋의 패치만 올린다 - required: true - type: string permissions: {} +# 승인을 기다리는 실행이 있으면 다음 실행은 그 뒤에 줄을 서서, 같은 패치의 승인 요청이 쌓이지 않는다. concurrency: group: ops-pull cancel-in-progress: false jobs: - pull: + scan: runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + outputs: + pending: ${{ steps.scan.outputs.pending }} + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - id: scan + uses: TeamPiKi/infra/.github/actions/ops-pull@main + with: + mode: scan + ops-deploy-key: ${{ secrets.OPS_DEPLOY_KEY }} + + open: + needs: scan + if: needs.scan.outputs.pending != '[]' + # 승인하는 사람이 ops 이슈의 sha 와 맞춰 볼 수 있게 40자 전체를 둔다. 앞 몇 자리는 루틴이 맞춰 만들 수 있다. + name: open ${{ matrix.id }} @ ${{ matrix.commit }} + runs-on: ubuntu-latest + environment: ops-approval permissions: contents: write pull-requests: write actions: write + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.scan.outputs.pending) }} steps: - uses: actions/checkout@v4 - uses: TeamPiKi/infra/.github/actions/ops-pull@main with: - id: ${{ inputs.id }} - ops-commit: ${{ inputs.ops_commit }} + mode: pr + id: ${{ matrix.id }} + ops-commit: ${{ matrix.commit }} ops-deploy-key: ${{ secrets.OPS_DEPLOY_KEY }} deny-pattern: ${{ secrets.OPS_DENY_PATTERN }} From 34ebd9ddb3158d1c17a066ae2877edf99e073da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EC=9E=AC=EC=A4=91?= <126754298+m-a-king@users.noreply.github.com> Date: Thu, 15 Oct 2026 16:21:56 +0900 Subject: [PATCH 3/4] =?UTF-8?q?chore:=20ops-pull=20=EC=9D=84=20=EC=8A=B9?= =?UTF-8?q?=EC=9D=B8=20=EC=9D=B4=EC=8A=88=20=EC=B2=B4=ED=81=AC=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=EB=A1=9C=20=EC=A0=84=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 예약 실행(KST 12시·24시)이 새 패치마다 승인 이슈를 만듦 - 쓰기 권한이 있는 사람이 이슈의 체크박스를 체크하면 그 패치로 PR 을 엶 - 원인: renderer·extractor 의 승인 방식이 달라 헷갈림. 두 repo 가 같은 파일을 씀 - 같은 패치의 승인은 이슈 제목 단위로 차례로 돎 --- .github/workflows/ops-pull.yml | 57 ++++++++++++++++------------------ 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ops-pull.yml b/.github/workflows/ops-pull.yml index 09d371f..16407db 100644 --- a/.github/workflows/ops-pull.yml +++ b/.github/workflows/ops-pull.yml @@ -1,61 +1,58 @@ -# 루틴이 ops 에 남긴 패치를 사람이 승인하면 PR 로 연다. 검사·CI 승인 로직은 infra 의 ops-pull 정본. -# 공개 repo 라 브랜치도 승인 전에는 올리지 않는다. 승인은 environment ops-approval 의 required reviewer. +# 루틴이 ops 에 남긴 패치마다 승인 이슈를 만들고, 쓰기 권한이 있는 사람이 체크하면 그 패치로 PR 을 연다. +# 로직은 infra 의 ops-pull 정본. renderer·extractor 가 같은 파일을 쓴다. name: Ops Pull on: - # 매일 아침 루틴이 끝난 뒤와 오후 한 번. 루틴 시각은 claude.ai 루틴 설정이 정본 + # KST 12시·24시. 매일 아침 루틴(시각은 claude.ai 루틴 설정이 정본)이 끝난 뒤 승인 이슈를 만든다 schedule: - - cron: '47 0,4 * * *' + - cron: '0 3,15 * * *' workflow_dispatch: + issues: + types: [edited] permissions: {} -# 승인을 기다리는 실행이 있으면 다음 실행은 그 뒤에 줄을 서서, 같은 패치의 승인 요청이 쌓이지 않는다. -concurrency: - group: ops-pull - cancel-in-progress: false - jobs: - scan: + request: + if: github.event_name != 'issues' runs-on: ubuntu-latest + concurrency: + group: ops-pull-request + cancel-in-progress: false permissions: contents: read + issues: write pull-requests: read - outputs: - pending: ${{ steps.scan.outputs.pending }} steps: - uses: actions/checkout@v4 - with: - persist-credentials: false - - id: scan - uses: TeamPiKi/infra/.github/actions/ops-pull@main + - uses: TeamPiKi/infra/.github/actions/ops-pull@main with: - mode: scan + mode: request ops-deploy-key: ${{ secrets.OPS_DEPLOY_KEY }} - open: - needs: scan - if: needs.scan.outputs.pending != '[]' - # 승인하는 사람이 ops 이슈의 sha 와 맞춰 볼 수 있게 40자 전체를 둔다. 앞 몇 자리는 루틴이 맞춰 만들 수 있다. - name: open ${{ matrix.id }} @ ${{ matrix.commit }} + approve: + # 봇이 만든 승인 이슈의 편집만 받는다. 승인 여부와 체크한 사람의 권한은 정본이 다시 판정한다 + if: >- + github.event_name == 'issues' + && github.event.issue.user.login == 'github-actions[bot]' + && startsWith(github.event.issue.title, 'ops 패치 ') runs-on: ubuntu-latest - environment: ops-approval + # 제목에 패치 id 가 들어 있어 같은 패치의 승인은 이슈가 달라도 차례로 돈다 + concurrency: + group: ops-pull-approve-${{ github.event.issue.title }} + cancel-in-progress: false permissions: contents: write + issues: write pull-requests: write actions: write - strategy: - fail-fast: false - matrix: - include: ${{ fromJSON(needs.scan.outputs.pending) }} steps: - uses: actions/checkout@v4 - uses: TeamPiKi/infra/.github/actions/ops-pull@main with: - mode: pr - id: ${{ matrix.id }} - ops-commit: ${{ matrix.commit }} + mode: approve ops-deploy-key: ${{ secrets.OPS_DEPLOY_KEY }} + # 공개 repo 에서만 필요하다. 비공개 repo 는 이 시크릿이 없어도 된다 deny-pattern: ${{ secrets.OPS_DENY_PATTERN }} From 5a66457eb0f66954c2ddbc22fafbac63e580c957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EC=9E=AC=EC=A4=91?= <126754298+m-a-king@users.noreply.github.com> Date: Thu, 15 Oct 2026 16:54:11 +0900 Subject: [PATCH 4/4] =?UTF-8?q?chore:=20ops-pull=20=EC=98=88=EC=95=BD=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=81=EC=9D=84=20=EB=A3=A8=ED=8B=B4=20=EB=92=A4?= =?UTF-8?q?=EB=A1=9C=20=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 승인 이슈 생성을 KST 12시·24시에서 0시 30분·12시 30분으로 옮김 - 원인: 루틴이 0시·12시에 돌아 그 직후에 패치를 받아야 함 --- .github/workflows/ops-pull.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ops-pull.yml b/.github/workflows/ops-pull.yml index 16407db..cf62d7c 100644 --- a/.github/workflows/ops-pull.yml +++ b/.github/workflows/ops-pull.yml @@ -3,9 +3,9 @@ name: Ops Pull on: - # KST 12시·24시. 매일 아침 루틴(시각은 claude.ai 루틴 설정이 정본)이 끝난 뒤 승인 이슈를 만든다 + # KST 0시 30분·12시 30분. 0시·12시 루틴(시각은 claude.ai 루틴 설정이 정본)이 끝난 뒤 승인 이슈를 만든다 schedule: - - cron: '0 3,15 * * *' + - cron: '30 3,15 * * *' workflow_dispatch: issues: types: [edited]