Skip to content

Label for stale render deploys #15

Label for stale render deploys

Label for stale render deploys #15

name: Label for stale render deploys
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
permissions:
issues: write
jobs:
label-stale-deploys:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: akshaysasidrn/[email protected]
id: stale-label
with:
github-token: ${{ secrets.TJ_BOT_PAT }}
stale-label: "active-path-review-app"
stale-time: "86400"
type: "pull_request"
- name: Get stale numbers
run: echo "Matched PR numbers - ${{ steps.stale-label.outputs.stale-numbers }}"
- name: Add suspend label
uses: actions/github-script@v6
env:
STALE_NUMBERS: ${{ steps.stale-label.outputs.stale-numbers }}
with:
github-token: ${{ secrets.TJ_BOT_PAT }}
script: |
if (!process.env.STALE_NUMBERS) return
const prNumbers = process.env.STALE_NUMBERS.split(",")
console.log(`Adding suspend labels for: ${prNumbers}`)
for (const prNumber of prNumbers) {
github.rest.issues.addLabels({
issue_number: prNumber,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['suspend-review-app']
})
}