Skip to content

Commit b542aef

Browse files
committed
Resync all GitHub Actions with the latest versions on "main" branch of DSpace/DSpace. This includes adding the "stale" action.
1 parent 82141a9 commit b542aef

5 files changed

Lines changed: 85 additions & 8 deletions

File tree

.github/workflows/issue_opened.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ on:
88
permissions: {}
99
jobs:
1010
automation:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-slim
1212
steps:
1313
# Add the new issue to a project board, if it needs triage
1414
# See https://github.com/actions/add-to-project
1515
- name: Add issue to triage board
1616
# Only add to project board if issue is flagged as "needs triage" or has no labels
1717
# NOTE: By default we flag new issues as "needs triage" in our issue template
1818
if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '')
19-
uses: actions/add-to-project@v0.5.0
19+
uses: actions/add-to-project@v2
2020
# Note, the authentication token below is an ORG level Secret.
2121
# It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions
2222
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token

.github/workflows/label_merge_conflicts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
triage:
1919
# Ensure this job never runs on forked repos. It's only executed for 'DSpace/RestContract'
2020
if: github.repository == 'dspace/restcontract'
21-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-slim
2222
permissions:
2323
pull-requests: write
2424
steps:

.github/workflows/port_merged_pull_request.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,23 @@ permissions:
1818

1919
jobs:
2020
port_pr:
21-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-slim
2222
# Don't run on closed *unmerged* pull requests
2323
if: github.event.pull_request.merged
2424
steps:
2525
# Checkout code
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v7
27+
with:
28+
# When using 'pull_request_target' (see above), this 'checkout' step will always fail because it
29+
# may make the codebase vulnerable to "pwn requests" via the user-created PR.
30+
# See https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target
31+
# However, we are allowing this unsafe checkout because (1) it's required to backport the PR, and
32+
# (2) this job only runs when a PR is MERGED, and merger only happens after a thorough review of the PR.
33+
allow-unsafe-pr-checkout: true
2734
# Port PR to other branch (ONLY if labeled with "port to")
2835
# See https://github.com/korthout/backport-action
2936
- name: Create backport pull requests
30-
uses: korthout/backport-action@v2
37+
uses: korthout/backport-action@v4
3138
with:
3239
# Trigger based on a "port to [branch]" label on PR
3340
# (This label must specify the branch name to port to)

.github/workflows/pull_request_opened.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ permissions:
1616

1717
jobs:
1818
automation:
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-slim
2020
steps:
2121
# Assign the PR to whomever created it. This is useful for visualizing assignments on project boards
2222
# See https://github.com/toshimaru/auto-author-assign
2323
- name: Assign PR to creator
24-
uses: toshimaru/auto-author-assign@v2.0.1
24+
uses: toshimaru/auto-author-assign@v3.0.3

.github/workflows/stale.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# DSpace rules for flagging untouched issues and PRs as stale using 'stale':
2+
# https://github.com/actions/stale
3+
name: 'Mark issues and PRs as stale'
4+
on:
5+
# Schedule to run weekly on Sunday at 2:03am UTC
6+
schedule:
7+
- cron: '3 2 * * 0'
8+
9+
permissions:
10+
issues: write
11+
pull-requests: write
12+
13+
jobs:
14+
stale:
15+
runs-on: ubuntu-slim
16+
steps:
17+
- uses: actions/stale@v10
18+
with:
19+
# Number of GitHub API calls to allow in a single run (to avoid hitting GitHub's rate limit)
20+
# Default is 30. But, we've found that only results in processing ~7 issues or PRs. So, we've increased it.
21+
operations-per-run: 60
22+
# Issues will be marked stale after 3 years of no activity
23+
days-before-issue-stale: 1095
24+
# Issues marked stale will be closed after one additional week of no activity
25+
days-before-issue-close: 7
26+
# High priority issues are never marked stale
27+
exempt-issue-labels: 'high priority'
28+
# When an issue is marked stale, this label and comment will be added to the issue.
29+
stale-issue-label: stale
30+
stale-issue-message: |
31+
This issue has been automatically marked as stale because it has not had
32+
activity in 3 years. It will be closed in 7 days if no further activity occurs.
33+
34+
Allowing issues to close as stale helps us filter out issues which can wait
35+
for future development time. All issues closed by this bot will continue to act
36+
like normal issues; they can be searched for, commented on or reopened at any point.
37+
38+
To extend the lifetime of an issue please comment below. This will help us to see
39+
that this issue is still affecting you with current versions of DSpace, and encourage
40+
us to re-prioritize this issue.
41+
# When an issue is closed, this comment will be added to the issue.
42+
close-issue-message: |
43+
This issue has been closed automatically as "stale". If this still affects you please
44+
request to re-open this issue via a comment, providing us with details on how this still
45+
impacts your usage of DSpace.
46+
# PRs will be marked stale after 1 year of no activity
47+
days-before-pr-stale: 365
48+
# PRs marked stale will be closed after two additional weeks of no activity
49+
days-before-pr-close: 14
50+
# High priority PRs are never marked stale
51+
exempt-pr-labels: 'high priority'
52+
# When a PR is marked stale, this label and comment will be added to the issue.
53+
stale-pr-label: stale
54+
stale-pr-message: |
55+
This pull request has been automatically marked as stale because it has not had
56+
activity in one year. It will be closed in 14 days if no further activity occurs.
57+
58+
Allowing pull requests to close as stale helps us filter out old work that is no longer
59+
relevant and helps developers focus on reviewing current work.
60+
61+
All pull requests closed by this bot act like normal pull requests;
62+
they can be searched for, commented on or reopened at any point.
63+
64+
If these changes are still relevant then please comment and/or rebase your PR based on the
65+
latest DSpace code. This will remove the stale status and notify us to assign a reviewer
66+
for your PR.
67+
close-pr-message: |
68+
This pull request has been closed automatically. If these changes are still relevant
69+
then please re-open this pull request with a comment and rebase your PR based on the latest
70+
DSpace code. This will notify us to assign a reviewer to your PR.

0 commit comments

Comments
 (0)