Skip to content

Commit 70eefd3

Browse files
committed
- adds a delay before closing agenda issues
- adds pinning and unpinning of agenda issues Signed-off-by: Vincent Biret <[email protected]>
1 parent 278474d commit 70eefd3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/agenda.yaml

+7-2
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,20 @@ jobs:
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424
TITLE_PREFIX: "Open Community (TDC) Meeting, "
2525
LABEL: "Housekeeping"
26+
POST_MEETING_CLOSE_DURATION_IN_DAYS: 10
2627

2728
runs-on: ubuntu-latest
2829

2930
steps:
3031
- uses: actions/checkout@v4 # checkout repo content
3132

3233
- name: Create agenda issue
33-
run: gh issue create -l ${{ env.LABEL }} -t "${{ env.TITLE_PREFIX }}`date --date='next Thu' +'%A %d %B %Y'`" -F .github/templates/agenda.md
34+
run: |
35+
$nextThursday = @(@(1..8) | % {$(Get-Date).AddDays($_)} | ? {$_.DayOfWeek -ieq "Thursday"})[0].ToString("dddd dd MMMM yyyy", [CultureInfo]::InvariantCulture)
36+
$result = gh issue create -l ${{ env.LABEL }} -t "${{ env.TITLE_PREFIX }}$nextThursday" -F .github/templates/agenda.md
37+
gh issue pin $result
38+
shell: pwsh
3439

3540
- name: Close old agenda issues
36-
run: gh issue list -l ${{ env.LABEL }} --author "app/github-actions" --json number,title | ConvertFrom-Json | Where-Object { $_.title -like "${{ env.TITLE_PREFIX }}*" -and [datetime]::Parse([regex]::Replace($_.title.Replace("${{ env.TITLE_PREFIX }}", ""), "\([^)]+\)", "")) -le [datetime]::UtcNow} | ForEach-Object { gh issue close $_.number }
41+
run: gh issue list -l ${{ env.LABEL }} --author "app/github-actions" --json number,title | ConvertFrom-Json | Where-Object { $_.title -like "${{ env.TITLE_PREFIX }}*" -and ([datetime]::UtcNow - [datetime]::Parse([regex]::Replace($_.title.Replace("${{ env.TITLE_PREFIX }}", ""), "\([^)]+\)", ""))) -ge [timespan]::FromDays([int]::Parse("${{ env.POST_MEETING_CLOSE_DURATION_IN_DAYS }}"))} | ForEach-Object { gh issue close $_.number && gh issue unpin $_.number }
3742
shell: pwsh

0 commit comments

Comments
 (0)