Skip to content

Commit b75043a

Browse files
committed
🔧 Fix RSS automation workflows
- Replace deprecated rss-fetch-action with modern rss-parser - Add proper permissions (contents: write) for automated commits - Switch to built-in GITHUB_TOKEN instead of custom secret - Add manual trigger capability for testing - Improve error handling and commit detection - Add comprehensive troubleshooting documentation - Update JSON data structure for better compatibility - Add .gitignore to prevent committing node_modules ✅ Tested: Both RSS feeds are working with current Sept 2025 data 📚 Docs: Complete setup guide in .github/workflows/README.md Fixes automation issues that prevented Expert Hub from auto-updating with latest GitHub Copilot news and incidents.
1 parent 595924a commit b75043a

File tree

6 files changed

+547
-29
lines changed

6 files changed

+547
-29
lines changed

.github/workflows/README.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# RSS Feed Automation Setup & Troubleshooting
2+
3+
This directory contains GitHub Actions workflows that automatically update the Expert Hub with the latest GitHub Copilot news and incidents.
4+
5+
## 🤖 Automated Workflows
6+
7+
### 1. `rss-changelog-feed.yml`
8+
- **Purpose**: Fetches latest GitHub Copilot updates from the GitHub Blog
9+
- **Schedule**: Runs twice daily (12 AM and 12 PM UTC)
10+
- **Updates**: `docs/copilot/changelog.json` and `docs/copilot/copilot-changelog.md`
11+
12+
### 2. `rss-incident-feed.yml`
13+
- **Purpose**: Fetches GitHub status incidents (highlighting Copilot-related ones)
14+
- **Schedule**: Runs twice daily (12:10 AM and 12:10 PM UTC)
15+
- **Updates**: `docs/copilot/incidents.json` and `docs/copilot/copilot-incidents.md`
16+
17+
## 🔧 Setup Requirements
18+
19+
### Repository Settings
20+
The workflows now use the built-in `GITHUB_TOKEN` with `contents: write` permissions. No additional secrets are required.
21+
22+
### Manual Triggers
23+
Both workflows can be triggered manually via the GitHub Actions UI using the "workflow_dispatch" event.
24+
25+
## 🚨 Common Issues & Solutions
26+
27+
### Issue 1: Workflows Not Running
28+
**Problem**: Scheduled workflows don't execute
29+
**Solutions**:
30+
1. Check if the repository is active (has commits in the last 60 days)
31+
2. Verify workflows are enabled in repository settings
32+
3. Check the Actions tab for any error messages
33+
34+
### Issue 2: Permission Denied Errors
35+
**Problem**: Workflow can't push changes back to repository
36+
**Solutions**:
37+
1. Ensure `contents: write` permission is set in workflow
38+
2. Check if branch protection rules are blocking automated commits
39+
3. Verify `GITHUB_TOKEN` has necessary permissions
40+
41+
### Issue 3: RSS Feed Parse Errors
42+
**Problem**: Cannot fetch or parse RSS feeds
43+
**Solutions**:
44+
1. Check if the RSS URLs are still valid:
45+
- Changelog: `https://github.blog/changelog/label/copilot/feed/`
46+
- Incidents: `https://www.githubstatus.com/history.rss`
47+
2. Test URLs manually with `curl -I <URL>`
48+
3. Check for network connectivity issues
49+
50+
### Issue 4: No Changes Detected
51+
**Problem**: Workflow runs but no updates are committed
52+
**Solutions**:
53+
1. This is normal if no new content is available
54+
2. Check the workflow logs to see if new entries were found
55+
3. Manually verify the RSS feeds have new content
56+
57+
## 🧪 Testing the Automation
58+
59+
### Manual Testing
60+
1. Go to Actions tab in your repository
61+
2. Select either workflow
62+
3. Click "Run workflow" to trigger manually
63+
4. Monitor the execution logs
64+
65+
### Local Testing Script
66+
You can test the RSS parsing locally:
67+
68+
```bash
69+
# Install dependencies
70+
npm install rss-parser
71+
72+
# Create and run test script
73+
node -e "
74+
const Parser = require('rss-parser');
75+
const parser = new Parser();
76+
77+
parser.parseURL('https://github.blog/changelog/label/copilot/feed/')
78+
.then(feed => {
79+
console.log('Feed Title:', feed.title);
80+
console.log('Latest Items:', feed.items.slice(0, 3).map(item => ({
81+
title: item.title,
82+
date: item.pubDate
83+
})));
84+
})
85+
.catch(console.error);
86+
"
87+
```
88+
89+
## 📊 Monitoring Automation Health
90+
91+
### Check Last Update Times
92+
- Look at the "Last updated" timestamp in the generated markdown files
93+
- Check the git commit history for automated commits
94+
95+
### Workflow Status
96+
- Green checkmark: Successful execution
97+
- Red X: Failed execution (check logs)
98+
- Yellow dot: In progress
99+
- Gray: Workflow disabled or skipped
100+
101+
### Expected Commit Pattern
102+
Successful runs should create commits with messages like:
103+
- `🤖 Automated update: Copilot changelog feed [Tue Sep 30 13:45:22 UTC 2025]`
104+
- `🤖 Automated update: GitHub incidents feed [Tue Sep 30 13:55:18 UTC 2025]`
105+
106+
## 🔄 Updating the Automation
107+
108+
### Changing Update Frequency
109+
Edit the `cron` schedules in the workflow files:
110+
```yaml
111+
on:
112+
schedule:
113+
- cron: '0 */6 * * *' # Every 6 hours instead of twice daily
114+
```
115+
116+
### Adding New RSS Sources
117+
1. Create a new workflow file following the existing pattern
118+
2. Update the RSS URL and output file paths
119+
3. Modify the markdown generation logic as needed
120+
121+
### Customizing Output Format
122+
Edit the JavaScript code in the "Run JavaScript to convert JSON to Markdown" step to change how the markdown is generated.
123+
124+
## 🆘 Getting Help
125+
126+
If the automation is still not working after following this guide:
127+
128+
1. **Check the workflow logs** in the Actions tab for specific error messages
129+
2. **Verify RSS feed accessibility** using curl or browser
130+
3. **Test permissions** by manually triggering a workflow
131+
4. **Check repository settings** for any restrictions on automated commits
132+
5. **Look at recent commits** to see if updates are happening but not visible
133+
134+
The automation should work out of the box for most repositories. The main requirement is that the repository remains active (recent commits) for scheduled workflows to continue running.

.github/workflows/rss-changelog-feed.yml

Lines changed: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,70 @@ name: Fetch Changelog Feed
33
on:
44
schedule:
55
- cron: '0 0,12 * * *' # Runs at midnight and noon every day
6+
workflow_dispatch: # Allow manual triggering for testing
67

78
jobs:
89
fetch-rss:
910
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write # Required to push changes back to repository
1013

1114
steps:
1215
- name: Checkout code
1316
uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
1419

15-
- name: Fetch Changelog Feed
16-
id: fetch-rss
17-
uses: Promptly-Technologies-LLC/rss-fetch-action@v2
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
1822
with:
19-
feed_url: 'https://github.blog/changelog/label/copilot/feed/'
20-
file_path: './docs/copilot/changelog.json'
23+
node-version: '18'
24+
25+
- name: Fetch and Process RSS Feed
26+
run: |
27+
# Install required dependencies
28+
npm install rss-parser
29+
30+
# Create Node.js script to fetch RSS and convert to JSON
31+
cat > fetch_rss.js << 'EOF'
32+
const Parser = require('rss-parser');
33+
const fs = require('fs');
34+
35+
const parser = new Parser();
36+
37+
async function fetchFeed() {
38+
try {
39+
const feed = await parser.parseURL('https://github.blog/changelog/label/copilot/feed/');
40+
41+
const jsonData = {
42+
title: feed.title,
43+
link: feed.link,
44+
description: feed.description,
45+
language: feed.language || 'en-US',
46+
generator: 'GitHub Actions RSS Parser',
47+
published: new Date().toISOString(),
48+
entries: feed.items.map(item => ({
49+
id: item.link,
50+
title: item.title,
51+
link: item.link,
52+
published: item.pubDate,
53+
description: item.contentSnippet || item.content || ''
54+
}))
55+
};
56+
57+
fs.writeFileSync('./docs/copilot/changelog.json', JSON.stringify(jsonData, null, 2));
58+
console.log('Successfully updated changelog.json');
59+
} catch (error) {
60+
console.error('Error fetching RSS feed:', error);
61+
process.exit(1);
62+
}
63+
}
64+
65+
fetchFeed();
66+
EOF
67+
68+
# Run the script
69+
node fetch_rss.js
2170
2271
- name: Run JavaScript to convert JSON to Markdown
2372
run: |
@@ -67,13 +116,14 @@ jobs:
67116
68117
- name: Commit changes to repository
69118
run: |
70-
git config --local user.email "[email protected]"
71-
git config --local user.name "GitHub Action"
72-
git add .
73-
git commit -m "Update RSS feed"
119+
# Check if there are changes to commit
120+
if git diff --quiet && git diff --cached --quiet; then
121+
echo "No changes to commit"
122+
exit 0
123+
fi
74124
75-
- name: Push to protected branch
76-
uses: CasperWA/push-protected@v2
77-
with:
78-
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}
79-
branch: main
125+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
126+
git config --local user.name "github-actions[bot]"
127+
git add ./docs/copilot/changelog.json ./docs/copilot/copilot-changelog.md
128+
git commit -m "🤖 Automated update: Copilot changelog feed [$(date)]"
129+
git push

.github/workflows/rss-incident-feed.yml

Lines changed: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,70 @@ name: Fetch Incidents Feed
33
on:
44
schedule:
55
- cron: '10 0,12 * * *' # Runs at midnight and noon every day
6+
workflow_dispatch: # Allow manual triggering for testing
67

78
jobs:
89
fetch-rss:
910
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write # Required to push changes back to repository
1013

1114
steps:
1215
- name: Checkout code
1316
uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
1419

15-
- name: Fetch Incidents Feed
16-
id: fetch-incidents
17-
uses: Promptly-Technologies-LLC/rss-fetch-action@v2
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
1822
with:
19-
feed_url: 'https://www.githubstatus.com/history.rss'
20-
file_path: './docs/copilot/incidents.json'
23+
node-version: '18'
24+
25+
- name: Fetch and Process RSS Feed
26+
run: |
27+
# Install required dependencies
28+
npm install rss-parser
29+
30+
# Create Node.js script to fetch RSS and convert to JSON
31+
cat > fetch_incidents.js << 'EOF'
32+
const Parser = require('rss-parser');
33+
const fs = require('fs');
34+
35+
const parser = new Parser();
36+
37+
async function fetchFeed() {
38+
try {
39+
const feed = await parser.parseURL('https://www.githubstatus.com/history.rss');
40+
41+
const jsonData = {
42+
title: feed.title,
43+
link: feed.link,
44+
description: feed.description,
45+
language: feed.language || '',
46+
generator: 'GitHub Actions RSS Parser',
47+
published: new Date().toISOString(),
48+
entries: feed.items.map(item => ({
49+
id: item.link,
50+
title: item.title,
51+
link: item.link,
52+
published: item.pubDate,
53+
description: item.contentSnippet || item.content || ''
54+
}))
55+
};
56+
57+
fs.writeFileSync('./docs/copilot/incidents.json', JSON.stringify(jsonData, null, 2));
58+
console.log('Successfully updated incidents.json');
59+
} catch (error) {
60+
console.error('Error fetching RSS feed:', error);
61+
process.exit(1);
62+
}
63+
}
64+
65+
fetchFeed();
66+
EOF
67+
68+
# Run the script
69+
node fetch_incidents.js
2170
2271
- name: Run JavaScript to convert JSON to Markdown
2372
run: |
@@ -114,13 +163,14 @@ jobs:
114163
115164
- name: Commit changes to repository
116165
run: |
117-
git config --local user.email "[email protected]"
118-
git config --local user.name "GitHub Action"
119-
git add .
120-
git commit -m "Update RSS feed"
166+
# Check if there are changes to commit
167+
if git diff --quiet && git diff --cached --quiet; then
168+
echo "No changes to commit"
169+
exit 0
170+
fi
121171
122-
- name: Push to protected branch
123-
uses: CasperWA/push-protected@v2
124-
with:
125-
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}
126-
branch: main
172+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
173+
git config --local user.name "github-actions[bot]"
174+
git add ./docs/copilot/incidents.json ./docs/copilot/copilot-incidents.md
175+
git commit -m "🤖 Automated update: GitHub incidents feed [$(date)]"
176+
git push

0 commit comments

Comments
 (0)