-
Notifications
You must be signed in to change notification settings - Fork 2.3k
163 lines (146 loc) · 7.74 KB
/
Shared-Stale.yml
File metadata and controls
163 lines (146 loc) · 7.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Mark stale pull requests
permissions:
issues: write
pull-requests: write
on:
workflow_call:
inputs:
RunDebug:
type: boolean
required: true
RepoVisibility:
type: string
required: true
secrets:
AccessToken:
required: true
jobs:
stale-private:
name: Stale check - private repos
runs-on: ubuntu-latest
if: github.repository_owner == 'MicrosoftDocs' && inputs.RepoVisibility == 'private'
steps:
# - name: Get selected month
# id: get-month
# shell: pwsh
# run: |
# # Define the starting week date and starting month date
# $StartingWeekDate = Get-Date "2024-10-31"
# $StartingMonthDate = Get-Date "2024-05-01"
# # Get the current date
# $CurrentDate = Get-Date
# # Calculate the number of weeks passed since the starting week date. If the current date is before the starting week date, the number of weeks passed is 0
# $DaysDifference = ($CurrentDate - $StartingWeekDate).Days
# $WeeksPassed = [math]::Max(0, [int]($DaysDifference / 7))
# # Calculate the month selected by subtracting the number of weeks passed from the starting month date
# $MonthSelectedDate = $StartingMonthDate.AddMonths(-$WeeksPassed)
# # Format the output date
# $FriendlyFormattedMonthSelected = $MonthSelectedDate.ToString("MMMM d, yyyy")
# $WorkflowFormattedMonthSelected = $MonthSelectedDate.ToString("yyyy-MM-ddT00:00:00Z")
# # Output the result
# Write-Host "For the current date $($CurrentDate.ToString('MMMM d, yyyy')), the month selected should be $FriendlyFormattedMonthSelected."
# Write-Host "Workflow-formatted date: $WorkflowFormattedMonthSelected"
# echo "SelectedMonth=$WorkflowFormattedMonthSelected" >> $env:GITHUB_OUTPUT
- uses: actions/stale@v9
# if: endsWith(steps.get-month.outputs.SelectedMonth, 'Z') # Make sure there's a date before running otherwise the stale action will run as if start-date doesn't exist.
with:
repo-token: ${{ secrets.AccessToken }}
debug-only: ${{ inputs.RunDebug }}
operations-per-run: 1000
days-before-issue-stale: 90
days-before-issue-close: 14
days-before-pr-stale: 90
days-before-pr-close: 14
# start-date: ${{ steps.get-month.outputs.SelectedMonth }}
stale-issue-label: Inactive
close-issue-label: Auto Closed
stale-pr-label: Inactive
close-pr-label: Auto Closed
exempt-pr-labels: Keep open
stale-issue-message: >
<h2>Inactive issue marked for closure</h2>
<p/>
This issue has been inactive for over 90 days, and an <b>Inactive</b> label has been added to it. If this issue remains inactive with no new comments, it will be closed automatically in 14 days.
close-issue-message: >
This issue has been inactive for a further 14 days and is now being closed.
stale-pr-message: >
<h2>Inactive PR marked for closure</h2>
<p/>
This pull request has been inactive for over 90 days, and an <b>Inactive</b> label has been added to it. If this PR remains inactive with no new comments, commits, or updates from main, it will be closed automatically in 14 days.
<p/>
<h3>Instructions for writer</h3>
<p/>
If you're ready to merge this PR, add the <b>Sign off</b> label to have the PR reviewed and merged by PubOps.
<p/>
If you're not ready to merge this PR yet and want to keep it open, click on <b>Update branch</b> at the bottom of this PR to bring it up to date with the main branch. The <b>Inactive</b> label will be removed within six hours.
<p/>
If the changes in this PR are no longer needed, click on <b>Close</b> at the bottom of the page. Please also delete the branch by clicking on <b>Delete branch</b>.
<p/>
To view a list of any open, inactive, PRs assigned to you, click <a href="https://github.com/search?q=is%3Apr+assignee%3A%40me+state%3Aopen+label%3A%22Inactive%22&type=pullrequests">Inactive PRs</a>.
<p/>
Thank you!
<p/>
PS: Mention <b>@marveldocs-pubops</b> in the comments if you need assistance.
close-pr-message: >
<h2>Closing inactive PR</h2>
This pull request has been inactive for a further 14 days and is now being closed.
<p/>
<h3>Instructions for writer</h3>
<p/>
If you decide to continue working on your changes, that's no problem. Simply select the <b>Reopen pull request</b> button at the bottom of the pull request.
<p/>
If the changes in this PR are no longer needed, please also delete the branch by clicking on <b>Delete branch</b>.
<p/>
<b>Warning</b> This branch may be subject to automatic deletion at a future date. Changes in the deleted branch will be lost.
<p/>
Thank you!
<p/>
PS: Mention <b>@marveldocs-pubops</b> in the comments if you need assistance.
# - name: Error on missing date
# if: endsWith(steps.get-month.outputs.SelectedMonth, 'Z') == false
# shell: pwsh
# env:
# SelectedMonth: ${{ steps.get-month.outputs.SelectedMonth}}
# run: |
# $SelectedMonth = $env:SelectedMonth
# Write-Error "The value in SelectedMonth, `"$SelectedMonth`", isn't a valid datetime. The stale action wasn't run."
# exit 1
# stale-public:
# name: Stale check - public repos
# runs-on: ubuntu-latest
# if: github.repository_owner == 'MicrosoftDocs' && inputs.RepoVisibility == 'public'
# steps:
# - uses: actions/stale@v9
# with:
# repo-token: ${{ secrets.AccessToken }}
# debug-only: ${{ inputs.RunDebug }}
# operations-per-run: 1000
# days-before-issue-stale: -1
# days-before-issue-close: -1
# days-before-pr-stale: -1
# days-before-pr-close: -1
# stale-pr-label: Inactive
# close-pr-label: Auto closed
# exempt-pr-labels: Keep open
# stale-pr-message: >
# <h2>Inactive PR marked for closure</h2>
# <p/>
# This pull request has been inactive for over 90 days, and an <b>Inactive</b> label has been added to it. If this PR remains inactive with no new comments, commits, or updates from main, it will be closed automatically in 14 days.
# <p/>
# <h3>Instructions for writer</h3>
# <p/>
# If you're ready to merge this PR, add the <b>Sign off</b> label to have the PR reviewed and merged by PubOps.
# <p/>
# If you're not ready to merge this PR yet and want to keep it open, click on <b>Update branch</b> at the bottom of this PR to bring it up to date with the main branch.
# <p/>
# To view a list of any open, inactive, PRs assigned to you, click <a href="https://github.com/search?q=is%3Apr+assignee%3A%40me+state%3Aopen+label%3A%22Inactive%22&type=pullrequests">Inactive PRs</a>.
# <p/>
# Thank you!
# <p/>
# PS: Mention <b>@marveldocs-pubops</b> in the comments if you need assistance.
# close-pr-message: >
# This pull request has been inactive for a further 14 days and is now being closed. If you decide to continue working on your changes, that's no problem. Simply select the <b>Reopen pull request</b> button at the bottom of the pull request.
# <br/>
# Thank you!
# <br/>
# PS: Mention <b>@marveldocs-pubops</b> in the comments if you need assistance.