SECOPS

SRI Hash PR Gate for New Scripts

On every pull request, scans changed HTML and templates for external <script> tags missing or mismatching Subresource Integrity hashes and blocks the merge with an inline GitHub…

CategorySecOps
Enginesim
Difficultyintermediate
Triggerevent
Steps4
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitHub pull request opened or synchronizedGitHubGitHub
  • ActionParse changed files for external script/link tagsGitHubGitHub
  • LogicValidate SRI present and hash matches fetched resource
  • OutputSet commit status and comment violations on PRGitHubGitHub

What it does

This workflow enforces Subresource Integrity at code-review time. When a pull request is opened or updated, it inspects the diff for any external `<script>` or `<link rel=stylesheet>` referencing a third-party origin. If a tag is added without an `integrity` attribute, or its declared hash does not match the actual fetched resource, the workflow fails a GitHub status check and comments the offending lines so the supply-chain risk never reaches production.

When to use it

Use it as a merge gate on any frontend repo that pulls scripts from CDNs or vendor domains. It turns SRI from a best-practice nobody remembers into an enforced contract on every PR.

How it works

  1. 1A GitHub pull_request event triggers the run.
  2. 2The changed files are pulled and parsed for external script and style tags.
  3. 3For tags with an SRI hash, the resource is fetched and re-hashed to confirm a match; tags without one are flagged.
  4. 4A logic step decides pass or fail based on missing or mismatched hashes.
  5. 5The result is written back as a GitHub commit status plus an inline review comment on each violation.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitHubRepos, issues, pull requests, actions.
  2. 2
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  3. 3
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  4. 4
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.