diff --git a/.github/workflows/ops-pull.yml b/.github/workflows/ops-pull.yml new file mode 100644 index 0000000..cf62d7c --- /dev/null +++ b/.github/workflows/ops-pull.yml @@ -0,0 +1,58 @@ +# 루틴이 ops 에 남긴 패치마다 승인 이슈를 만들고, 쓰기 권한이 있는 사람이 체크하면 그 패치로 PR 을 연다. +# 로직은 infra 의 ops-pull 정본. renderer·extractor 가 같은 파일을 쓴다. +name: Ops Pull + +on: + # KST 0시 30분·12시 30분. 0시·12시 루틴(시각은 claude.ai 루틴 설정이 정본)이 끝난 뒤 승인 이슈를 만든다 + schedule: + - cron: '30 3,15 * * *' + workflow_dispatch: + issues: + types: [edited] + +permissions: {} + +jobs: + 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 + steps: + - uses: actions/checkout@v4 + + - uses: TeamPiKi/infra/.github/actions/ops-pull@main + with: + mode: request + ops-deploy-key: ${{ secrets.OPS_DEPLOY_KEY }} + + approve: + # 봇이 만든 승인 이슈의 편집만 받는다. 승인 여부와 체크한 사람의 권한은 정본이 다시 판정한다 + if: >- + github.event_name == 'issues' + && github.event.issue.user.login == 'github-actions[bot]' + && startsWith(github.event.issue.title, 'ops 패치 ') + runs-on: ubuntu-latest + # 제목에 패치 id 가 들어 있어 같은 패치의 승인은 이슈가 달라도 차례로 돈다 + concurrency: + group: ops-pull-approve-${{ github.event.issue.title }} + cancel-in-progress: false + permissions: + contents: write + issues: write + pull-requests: write + actions: write + steps: + - uses: actions/checkout@v4 + + - uses: TeamPiKi/infra/.github/actions/ops-pull@main + with: + mode: approve + ops-deploy-key: ${{ secrets.OPS_DEPLOY_KEY }} + # 공개 repo 에서만 필요하다. 비공개 repo 는 이 시크릿이 없어도 된다 + deny-pattern: ${{ secrets.OPS_DENY_PATTERN }}