Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/pr-expiry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Auto-close stale PRs

on:
schedule:
- cron: "0 2 * * *" # Runs daily (UTC)
workflow_dispatch:

permissions:
pull-requests: write
issues: write

jobs:
manage-prs:
runs-on: ubuntu-latest
steps:
- name: Check PR age
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;

const prs = await github.paginate(
github.rest.pulls.list,
{ owner, repo, state: "open", per_page: 100 }
);

const now = new Date();

for (const pr of prs) {
const createdAt = new Date(pr.created_at);
const ageDays = Math.floor(
(now - createdAt) / (1000 * 60 * 60 * 24)
);

const author = pr.user.login;
const assignees = pr.assignees.map(a => `@${a.login}`).join(" ");
const mentions = [`@${author}`, assignees].join(" ");

if (ageDays === 3) {
await github.rest.issues.createComment({
owner,
repo,
issue_number: pr.number,
body: `${mentions}\n **Reminder:** Your PR can remain open for **2 more days**. Please take action.`
});
}

if (ageDays === 4) {
await github.rest.issues.createComment({
owner,
repo,
issue_number: pr.number,
body: `${mentions}\n **Reminder:** Your PR can remain open for **1 more day**.`
});
}

if (ageDays >= 5) {
await github.rest.issues.createComment({
owner,
repo,
issue_number: pr.number,
body: `${mentions}\n **Closing PR:** This PR has been open for more than **5 days** without activity. Closing automatically.`
});

await github.rest.pulls.update({
owner,
repo,
pull_number: pr.number,
state: "closed"
});
}
}
1 change: 1 addition & 0 deletions o/orc/orc_ubi_9.3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#
# ----------------------------------------------------------------------------


set -ex

PACKAGE_NAME=orc
Expand Down
Loading