Skip to content

Commit 278474d

Browse files
committed
- updates agenda workflow so it closes older agenda issues automatically
1 parent 7817060 commit 278474d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/agenda.yaml

+11-3
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,25 @@ on:
1313
schedule:
1414
- cron: '0 16 * * 4'
1515
workflow_dispatch: {}
16-
16+
17+
permissions:
18+
issues: write
19+
1720
jobs:
1821
agenda:
1922
env:
2023
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
TITLE_PREFIX: "Open Community (TDC) Meeting, "
25+
LABEL: "Housekeeping"
2126

2227
runs-on: ubuntu-latest
2328

2429
steps:
25-
- uses: actions/checkout@v1 # checkout repo content
30+
- uses: actions/checkout@v4 # checkout repo content
2631

2732
- name: Create agenda issue
28-
run: gh issue create -l Housekeeping -t "Open Community (TDC) Meeting, `date --date='next Thu' +'%A %d %B %Y'`" -F .github/templates/agenda.md
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
2934

35+
- 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 }
37+
shell: pwsh

0 commit comments

Comments
 (0)