Skip to content

Fixes PR updated_at comparison on Housekeep Actions (#690) #492

Fixes PR updated_at comparison on Housekeep Actions (#690)

Fixes PR updated_at comparison on Housekeep Actions (#690) #492

Workflow file for this run

name: Development Build
on:
push:
branches:
- main
concurrency: dev-${{ github.ref }}
jobs:
build-windows:
name: Build
uses: ./.github/workflows/ci-windows.yml
build-linux:
name: Build
uses: ./.github/workflows/ci-linux.yml
build-mac:
name: Build
uses: ./.github/workflows/ci-mac.yml
housekeep:
name: Housekeep
runs-on: ubuntu-latest
steps:
- name: Install Python modules
run: pip install PyGithub
- name: Update PRs
run: |
from datetime import datetime, timezone
from github import Auth, Github
now = datetime.now(timezone.utc)
gh = Github(auth=Auth.Token("${{ secrets.GITHUB_TOKEN }}"))
repo = gh.get_repo("${{ github.repository }}")
for pull in repo.get_pulls("open", "updated", "desc", "${{ github.ref_name }}"):
if (now - pull.updated_at).days > 30:
break
ood = False
for label in pull.labels:
if label.name == "B-out-of-date":
ood = True
if not ood:
pull.add_to_labels("B-out-of-date")
shell: python