#28718: Adding GH workflow to fetch open PRs and notify about them to… #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Close stale issues and 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-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 }} | |
script: | | |
async function fetchOpenPrs() { | |
return github.rest.pulls.get({ | |
owner: '${{ github.repository_owner }}', | |
repo: '${{ env.REPO }}', | |
state: 'open', | |
per_page: 100 | |
}); | |
} | |
const prs = await fetchOpenPrs(); | |
console.log(prs, null, 2); |