Add the Action
Create.github/workflows/mergeguide.yml in your repository:
.github/workflows/mergeguide.yml
Action inputs
| Input | Description | Default |
|---|---|---|
paths | Files or directories to check (space-separated). | . |
format | Output format: text, json, sarif, markdown. | text |
policy | Path to custom policy file(s) (space-separated). | — |
no-defaults | Skip the default policies. | false |
fail-on-warning | Exit with an error if warnings are found. | false |
sarif-file | Path to write SARIF output for code scanning. | — |
github-token | Token used to upload SARIF results. | ${{ github.token }} |
Action outputs
| Output | Description |
|---|---|
passed | Whether all checks passed (true / false). |
violations | Number of violations found. |
report | Path to the output report file (when sarif-file is set). |
Upload to GitHub code scanning
To make findings appear in the repository’s Security tab, write SARIF and upload it. Grant the jobsecurity-events: write:
.github/workflows/mergeguide.yml
Block merges on findings
To hold a merge until blocking findings are resolved, add the MergeGuide job to your branch’s required status checks in Settings → Branches. Once required, a pull request can’t merge while the check is failing. See Set up the PR gate.Next steps
PR gate
Block merges on blocking findings.
CI/CD patterns
Wire MergeGuide into any pipeline.