10
10
# `pull_request` event is triggered on a PR from a fork, GITHUB_TOKEN will
11
11
# be read-only, and the Action won't have access to any other repository
12
12
# secrets, which it needs to access Jenkins API.
13
- schedule :
14
- - cron : ' */5 * * * *'
13
+ # schedule:
14
+ # - cron: '*/5 * * * *'
15
+ workflow_dispatch :
16
+
15
17
16
18
concurrency : ${{ github.workflow }}
17
19
@@ -25,63 +27,82 @@ jobs:
25
27
get_mergeable_prs :
26
28
permissions :
27
29
pull-requests : read
28
- if : github.repository == 'nodejs/node'
30
+ # if: github.repository == 'nodejs/node'
29
31
runs-on : ubuntu-latest
30
32
outputs :
31
33
numbers : ${{ steps.get_mergeable_prs.outputs.numbers }}
32
34
steps :
33
35
- name : Get Pull Requests
34
36
id : get_mergeable_prs
35
37
run : >
36
- gh pr list \
38
+ echo 123
39
+ date
40
+ date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z"
41
+ prs=$(gh pr list \
37
42
--repo ${{ github.repository }} \
38
43
--base ${{ github.ref_name }} \
39
44
--label 'commit-queue' \
40
45
--json 'number' \
41
- -t '::set-output name=numbers::{{ range . }}{{ .number }} {{ end }}' \
42
- --limit 100
46
+ --search "created:<=$(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z")" \
47
+ -t '{{ range . }}{{ .number }} {{ end }}' \
48
+ --limit 100)
49
+ fast_track_prs=$(gh pr list \
50
+ --repo ${{ github.repository }} \
51
+ --base ${{ github.ref_name }} \
52
+ --label 'commit-queue' \
53
+ --label 'fast-track' \
54
+ --json 'number' \
55
+ -t '{{ range . }}{{ .number }} {{ end }}' \
56
+ --limit 100)
57
+ numbers=$(echo $prs' '$fast_track_prs | jq -r -s 'unique | join(" ")')
58
+ echo $prs
59
+ echo $fast_track_prs
60
+ echo $numbers
61
+ echo $(date --date="2 days ago" +"%Y-%m-%dT%H:%M:%S%z")
62
+ echo "numbers=$numbers" >> $GITHUB_OUTPUT
43
63
env :
44
64
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45
65
commitQueue :
46
66
needs : get_mergeable_prs
47
67
if : needs.get_mergeable_prs.outputs.numbers != ''
48
68
runs-on : ubuntu-latest
49
69
steps :
50
- - uses : actions/checkout@v3
51
- with :
52
- # Needs the whole git history for ncu to work
53
- # See https://github.com/nodejs/node-core-utils/pull/486
54
- fetch-depth : 0
55
- # A personal token is required because pushing with GITHUB_TOKEN will
56
- # prevent commits from running CI after they land. It needs
57
- # to be set here because `checkout` configures GitHub authentication
58
- # for push as well.
59
- token : ${{ secrets.GH_USER_TOKEN }}
70
+ - run : echo ${{ needs.get_mergeable_prs.outputs.numbers }}
71
+ # - uses: actions/checkout@v3
72
+ # with:
73
+ # # Needs the whole git history for ncu to work
74
+ # # See https://github.com/nodejs/node-core-utils/pull/486
75
+ # fetch-depth: 0
76
+ # # A personal token is required because pushing with GITHUB_TOKEN will
77
+ # # prevent commits from running CI after they land. It needs
78
+ # # to be set here because `checkout` configures GitHub authentication
79
+ # # for push as well.
80
+ # token: ${{ secrets.GH_USER_TOKEN }}
60
81
61
- # Install dependencies
62
- - name : Install Node.js
63
- uses : actions/setup-node@v3
64
- with :
65
- node-version : ${{ env.NODE_VERSION }}
66
- - name : Install node-core-utils
67
- run : npm install -g node-core-utils@latest
82
+ # # Install dependencies
83
+ # - name: Install Node.js
84
+ # uses: actions/setup-node@v3
85
+ # with:
86
+ # node-version: ${{ env.NODE_VERSION }}
87
+ # - name: Install node-core-utils
88
+ # run: npm install -g node-core-utils@latest
68
89
69
- - name : Set variables
70
- run : |
71
- echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
72
- echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
90
+ # - name: Set variables
91
+ # run: |
92
+ # echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV
93
+ # echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV
73
94
74
- - name : Configure node-core-utils
75
- run : |
76
- ncu-config set branch ${GITHUB_REF_NAME}
77
- ncu-config set upstream origin
78
- ncu-config set username "${{ secrets.GH_USER_NAME }}"
79
- ncu-config set token "${{ secrets.GH_USER_TOKEN }}"
80
- ncu-config set jenkins_token "${{ secrets.JENKINS_TOKEN }}"
81
- ncu-config set repo "${REPOSITORY}"
82
- ncu-config set owner "${OWNER}"
95
+ # - name: Configure node-core-utils
96
+ # run: |
97
+ # ncu-config set branch ${GITHUB_REF_NAME}
98
+ # ncu-config set upstream origin
99
+ # ncu-config set username "${{ secrets.GH_USER_NAME }}"
100
+ # ncu-config set token "${{ secrets.GH_USER_TOKEN }}"
101
+ # ncu-config set jenkins_token "${{ secrets.JENKINS_TOKEN }}"
102
+ # ncu-config set repo "${REPOSITORY}"
103
+ # ncu-config set owner "${OWNER}"
83
104
84
- - name : Start the Commit Queue
85
- run : ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} ${{ needs.get_mergeable_prs.outputs.numbers }}
86
- env :
87
- GITHUB_TOKEN : ${{ secrets.GH_USER_TOKEN }}
105
+ # - name: Start the Commit Queue
106
+ # run: ./tools/actions/commit-queue.sh ${{ env.OWNER }} ${{ env.REPOSITORY }} ${{ needs.get_mergeable_prs.outputs.numbers }}
107
+ # env:
108
+ # GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }}
0 commit comments