Repository navigation
Publish public Discussions feed #72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish public Discussions feed | |
| on: | |
| discussion: | |
| types: [created, edited, deleted, answered, unanswered] | |
| discussion_comment: | |
| types: [created, edited, deleted] | |
| schedule: | |
| - cron: "17 * * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| discussions: read | |
| concurrency: | |
| group: public-discussions-feed | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Generate feed from current Discussions | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: node scripts/generate-feed.mjs | |
| - name: Commit changed feed | |
| run: | | |
| if git diff --quiet -- docs/feed.json; then | |
| echo "Feed is already current." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add docs/feed.json | |
| git commit -m "chore: refresh public Discussions feed" | |
| git push |