-
Notifications
You must be signed in to change notification settings - Fork 0
ORB-164: register git-guardrails on PowerShell and carry the external-interface and never-admin-merge rules in AGENTS.md #442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+150
−6
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
380cb6f
ORB-164: register git-guardrails on the PowerShell tool as well as Bash
thomasluizon c0175ea
ORB-164: carry the external-interface and never-admin-merge rules in …
thomasluizon 988e04c
ORB-164: replace CodeQL default setup with an advanced-setup workflow
thomasluizon 1d9beca
ORB-164: run SonarCloud on Dependabot pull requests
thomasluizon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: CodeQL | ||
|
|
||
| # CodeQL advanced setup, replacing default setup (ORB-164). | ||
| # | ||
| # Default setup does not run on Dependabot pull requests (github/codeql-action | ||
| # issue 2858), so the three contexts branch protection requires on main, | ||
| # "Analyze (csharp)", "Analyze (javascript-typescript)" and "Analyze (actions)", | ||
| # never reported on a Dependabot head and every Dependabot pull request stayed | ||
| # permanently BLOCKED. An advanced-setup workflow is an ordinary workflow, so it | ||
| # triggers on a Dependabot head like every other job in this repository, and the | ||
| # job-level permissions block below is honoured there. GitHub's "Troubleshooting | ||
| # Dependabot on GitHub Actions" documents both halves: a Dependabot-triggered run | ||
| # "receives a read-only GITHUB_TOKEN and does not have access to any secrets", and | ||
| # "you can use the permissions key in your workflow to increase the access for the | ||
| # token", which is exactly what the analyze job does for security-events. | ||
| # | ||
| # The job name is load bearing. A matrix job produces one check run per leg, | ||
| # named by interpolating the job name, so "Analyze (${{ matrix.language }})" | ||
| # over these three languages reproduces the three required contexts verbatim. | ||
| # Renaming this job, or changing a matrix language value, silently makes main | ||
| # unmergeable for every pull request. | ||
| # | ||
| # The language set matches what default setup covered: csharp, | ||
| # javascript-typescript and actions. C# is analyzed with a real build rather | ||
| # than buildless extraction, because this repository generates code at build | ||
| # time (LoggerMessage source generators, openapi.json) and because a | ||
| # GitHub-side feature flag can turn build-mode "none" into "autobuild" without | ||
| # warning. The build steps are the ones API Tests already proves. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: "0 5 * * 1" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: Analyze (${{ matrix.language }}) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
|
|
||
| permissions: | ||
| security-events: write | ||
| actions: read | ||
| contents: read | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - language: csharp | ||
| build-mode: manual | ||
| - language: javascript-typescript | ||
| build-mode: none | ||
| - language: actions | ||
| build-mode: none | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
||
| - name: Setup .NET | ||
| if: matrix.build-mode == 'manual' | ||
| uses: actions/setup-dotnet@v6 | ||
| with: | ||
| dotnet-version: "10.0.x" | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| build-mode: ${{ matrix.build-mode }} | ||
|
|
||
| - name: Build | ||
| if: matrix.build-mode == 'manual' | ||
| run: | | ||
| dotnet restore | ||
| dotnet build --no-restore | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 | ||
| with: | ||
| category: "/language:${{ matrix.language }}" |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a worker invokes
gh pr merge --adminor either raw API form, this prohibition remains advisory: the repository-wide search finds no enforcement, andgit-guardrails.mjsimmediately allows commands without the wordgit(a direct hook invocation with theghcommand exits 0). Because an admin merge bypasses the protections that could reject it after execution, add a pre-execution gate covering all three listed forms rather than placing this rule among guardrails described as mechanically enforced.AGENTS.md reference: AGENTS.md:L26-L29
Useful? React with 👍 / 👎.