-
Notifications
You must be signed in to change notification settings - Fork 467
41 lines (39 loc) · 1.22 KB
/
cicd_scheduled_notify-seated-prs.yml
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
name: 'Notify about seated PRs'
on:
schedule:
- cron: '0 6 * * *'
push:
branches:
- 28718-notify-seated-prs
jobs:
notify-about-prs:
runs-on: ubuntu-22.04
env:
REPO: core
steps:
- run: echo 'GitHub context'
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
- id: fetch-seated-prs
name: Fetch PRs
uses: actions/github-script@v7
with:
result-encoding: string
retries: 3
retry-exempt-status-codes: 400,401
github-token: ${{ secrets.CI_MACHINE_TOKEN }}
base-url: https://api.github.com/repos/dotCMS/core/pulls?per_page=100
debug: true
script: |
async function fetchOpenPrs() {
const opts = github.rest.pulls.get.endpoint.merge({
owner: '${{ github.repository_owner }}',
repo: '${{ env.REPO }}'
});
const response = github.paginate(opts);
console.log(JSON.stringify(response, null, 2));
return response.data;
}
const prs = await fetchOpenPrs();
console.log(`PRs: ${prs.length}`);
console.log(JSON.stringify(prs, null, 2));