Skip to content

Commit 7821d19

Browse files
Timna BrownTimna Brown
authored andcommitted
Adjust welcome discussion workflows
1 parent 7af0d4f commit 7821d19

4 files changed

Lines changed: 32 additions & 55 deletions

File tree

.github/workflows/discussions-welcome.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/ensure-welcome-discussion.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Ensure Welcome Discussion
22

33
on:
4-
schedule:
5-
- cron: '30 6 * * 1'
64
workflow_dispatch:
75

86
permissions:
@@ -31,5 +29,5 @@ jobs:
3129
ARCHIVE_CONFIG: docs/discussions/archive.json
3230
WELCOME_TEMPLATE: docs/welcome-draft.md
3331
WELCOME_TITLE: Welcome to the organization Discussions
34-
WELCOME_CATEGORY: General
32+
WELCOME_CATEGORY: Announcements
3533
run: python .github/workflows/ensure_welcome_discussion.py

.github/workflows/ensure_welcome_discussion.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
id
3434
title
3535
url
36+
category {
37+
name
38+
}
3639
}
3740
pageInfo {
3841
hasNextPage
@@ -139,10 +142,15 @@ def find_category_id(categories, name):
139142
return None
140143

141144

142-
def find_discussion_by_title(discussions, title):
145+
def find_discussion_by_title(discussions, title, category_name=None):
143146
title_normalized = normalize_title(title)
147+
category_normalized = normalize_title(category_name) if category_name else None
144148
for item in discussions:
145149
if normalize_title(item.get("title")) == title_normalized:
150+
if category_normalized:
151+
item_category = item.get("category") or {}
152+
if normalize_title(item_category.get("name")) != category_normalized:
153+
continue
146154
return item
147155
return None
148156

@@ -175,7 +183,7 @@ def main():
175183
raise RuntimeError(f"Category not found: {WELCOME_CATEGORY}")
176184

177185
discussions = fetch_discussions(org, TOKEN)
178-
existing = find_discussion_by_title(discussions, WELCOME_TITLE)
186+
existing = find_discussion_by_title(discussions, WELCOME_TITLE, WELCOME_CATEGORY)
179187

180188
if existing:
181189
discussion_id = existing.get("id")

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ Last updated: 2026-03-04
1111

1212
> This repository is the **home of GitHub Discussions** for the organization.
1313
14+
<details>
15+
<summary>Table of contents</summary>
16+
17+
- [Start here](#start-here)
18+
- [Categories](#categories)
19+
- [Automation](#automation)
20+
- [How we keep discussions useful](#how-we-keep-discussions-useful)
21+
22+
</details>
23+
1424
> E.g:
1525
1626
<img width="1896" height="782" alt="image" src="https://github.com/user-attachments/assets/313bb41a-d11f-4f19-b5a4-7255a67e40c8" />
@@ -21,6 +31,7 @@ Use it to:
2131
- Propose ideas and gather feedback
2232
- Host lightweight RFCs / design discussions
2333

34+
2435
## Start here
2536

2637
- **Want to ask a question?** Create a Discussion in [Q&A](https://github.com/orgs/MicrosoftCloudEssentials-LearningHub/discussions/categories/q-a) and include:
@@ -43,6 +54,16 @@ Quick pointers:
4354
- [Show and tell](https://github.com/orgs/MicrosoftCloudEssentials-LearningHub/discussions/categories/show-and-tell): what you built (demos/integrations)
4455
- [Events](https://github.com/orgs/MicrosoftCloudEssentials-LearningHub/discussions/categories/events): meetups/livestreams/webinars
4556

57+
## Automation
58+
59+
| Workflow | Trigger | Purpose | Secrets |
60+
|---|---|---|---|
61+
| [Archive Discussions](.github/workflows/archive-discussions.yml) | Monthly (1st 06:20 UTC), manual | Sync org discussions into docs/discussions | `TRAFFIC_TOKEN` |
62+
| [Create Monthly Catalog Discussion](.github/workflows/create-monthly-catalog-discussion.yml) | Monthly (1st 06:05 UTC), manual | Create the monthly catalog discussion, then archive it | `TRAFFIC_TOKEN` |
63+
| [Ensure Welcome Discussion](.github/workflows/ensure-welcome-discussion.yml) | Manual (run once) | Create and pin the welcome discussion | `TRAFFIC_TOKEN` |
64+
| [Update Last Modified Date](.github/workflows/update-md-date.yml) | Pull request to main | Stamp changed markdown files with Last updated | `GITHUB_TOKEN` |
65+
| [Use Visitor Counter Logic](.github/workflows/use-visitor-counter.yml) | Pull request to main, manual | Refresh view counter badges and metrics | `TRAFFIC_TOKEN` |
66+
4667
## How we keep discussions useful
4768

4869
- **Search first** (duplicate threads slow everyone down)

0 commit comments

Comments
 (0)