Repository navigation
53 lines (49 loc) · 2.14 KB
/
Copy pathmerge-queue-requeue.yml
File metadata and controls
53 lines (49 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# merge queue 재투입 (merge-queue-dequeue.yml 이 dispatch)
#
# GITHUB_TOKEN 으로 큐에 넣으면 GitHub 이 그 이벤트로 워크플로를 띄우지 않아 merge_group CI 가 하나도 돌지 않는다.
# 큐는 check timeout(60분)까지 기다렸다가 CI_TIMEOUT 으로 빼고, 그 뒤에 쌓인 PR 들도 다시 검증한다.
# 그래서 투입은 사람 토큰(MERGE_QUEUE_TOKEN, OnlyReadOneBook 의 fine-grained PAT)으로 한다. 시크릿이 없으면 넣지 않고
# 직접 투입하라는 코멘트를 남긴다.
#
# 방출 판정과 마커 코멘트는 방출 처리 job 이 끝냈다. 여기서는 live 상태를 다시 보고 판정한 head 그대로 열려 있고
# 큐 밖일 때만 넣는다. default branch 의 스크립트만 실행하고 PR 코드는 체크아웃하지 않는다.
name: merge-queue-requeue
on:
workflow_dispatch:
inputs:
pull_request_number:
description: 재투입할 PR 번호
required: true
type: string
head_sha:
description: 방출 판정 때의 head SHA. 그사이 새 커밋이 올라왔으면 넣지 않는다.
required: true
type: string
permissions: {}
jobs:
requeue:
concurrency:
group: merge-queue-requeue-${{ github.repository_id }}-${{ inputs.pull_request_number }}
cancel-in-progress: false
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
issues: write
pull-requests: write
steps:
- name: Clone requeue policy from the default branch
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
sparse-checkout: .github/scripts
- name: 사람 토큰으로 재투입
env:
MODE: requeue
GITHUB_TOKEN: ${{ github.token }}
MERGE_QUEUE_TOKEN: ${{ secrets.MERGE_QUEUE_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
PULL_REQUEST_NUMBER: ${{ inputs.pull_request_number }}
HEAD_SHA: ${{ inputs.head_sha }}
run: node .github/scripts/handle-merge-queue-dequeue.mjs