Skip to content

chore: restrict workflow permissions and tighten feed script removal - #1809

Merged
julien-deramond merged 2 commits into
mainfrom
chore/maintenance-updates
Oct 10, 2026
Merged

julien-deramond merged 2 commits into
mainfrom
chore/maintenance-updates

Conversation

@julien-deramond

Copy link
Copy Markdown
Member

The Integration, Lint and Weekly workflows now set permissions: contents: read at the top, so their jobs get a read-only GITHUB_TOKEN by default. The Weekly links job keeps its own block, which still grants issues: write for the broken-links report.

feedHtml in src/feeds.ts now removes <script> elements in any case, with attributes on the closing tag, and repeats until none is left.

What was done

  • Each of the three workflow files gets one top-level permissions block. Nothing in them pushes with GITHUB_TOKEN. The showcase job reads public data through GraphQL, and its PR goes through SHOWCASE_PR_GITHUB_TOKEN, so it doesn't need write access.
  • The script regex now has the i flag and accepts </script > or attributes on the end tag, inside a loop that stops when the string no longer changes. A new test in tests/feeds.test.ts covers an uppercase tag and a nested one.
  • I compared the built feed.json with the live one. No article has a script element, so the feed content doesn't change. The only difference is the code-highlighting colours in one article, which script removal can't touch.
  • All green locally with npm run prettier:check, npm run spellcheck, npm run test -- --run (79 passed), npm run build, npm run links.
  • I couldn't run the Weekly workflow. It only runs on schedule or by hand, so the showcase job under the new permissions will only run on the next Monday or a manual dispatch.

How to review

  • Check by hand: after merging, run the Weekly workflow once with "Run workflow" and check the showcase job still opens its PR.

🤖 Generated with Claude Code

julien-deramond and others added 2 commits October 10, 2026 20:36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openresource-dev Ready Ready Preview Oct 10, 2026 8:06pm UTC

@julien-deramond
julien-deramond merged commit db57f75 into main Oct 10, 2026
8 checks passed
@julien-deramond
julien-deramond deleted the chore/maintenance-updates branch October 10, 2026 20:20

This branch was successfully deployed

1 active deployment
Preview — ca90e3f8 Deployed Oct 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant