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