Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
ci: gate typecheck, unit tests, and doc drift on every PR#61
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
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: Checks | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| # macos-latest, matching e2e.yml: much of the tree is macOS-specific (launchd | ||
| # labels, TCC, codesign, ~/Library paths) and the bunfig preload that isolates | ||
| # HOME for tests is exercised the same way developers run it locally. | ||
| jobs: | ||
| checks: | ||
| runs-on: macos-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: 1.3.13 | ||
| - name: Install dependencies | ||
| run: bun install --frozen-lockfile | ||
| - name: Typecheck | ||
| run: bunx tsc --noEmit | ||
| - name: Unit tests | ||
| run: bun test lib commands packages scripts | ||
| # Drift here is invisible until someone runs it by hand, which is how | ||
| # two commands reached main with no reference page. | ||
| - name: Command reference is in sync | ||
| run: bun run docs:check | ||
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,26 @@ | ||
| --- | ||
| title: rt code | ||
| sidebar_label: code | ||
| --- | ||
| # rt code | ||
| `rt › code` | ||
| Open a worktree in your preferred editor | ||
| ## Usage | ||
| ```bash | ||
| rt code [flags] | ||
| ``` | ||
| ## Arguments & flags | ||
| | Flag / Arg | Type | Default | Description | | ||
| | --- | --- | --- | --- | | ||
| | `--pick` | boolean | `false` | Force the worktree/repo picker instead of using the current repo (alias -p) | | ||
| _See code: [commands/code.ts › openInEditor](https://github.com/m4ttstack/rt/blob/main/commands/code.ts)_ | ||
| {/* generated by scripts/gen-docs.ts; edit prose in _partials, not here */} |
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,27 @@ | ||
| --- | ||
| title: rt repos prune | ||
| sidebar_label: prune | ||
| --- | ||
| # rt repos prune | ||
| `rt › repos › prune` | ||
| Drop index entries whose path is gone, and duplicate names left behind by a repo rename | ||
| ## Usage | ||
| ```bash | ||
| rt repos prune [flags] | ||
| ``` | ||
| ## Arguments & flags | ||
| | Flag / Arg | Type | Default | Description | | ||
| | --- | --- | --- | --- | | ||
| | [`--dry-run`](/guides/common-flags) | boolean | `false` | Print what would be removed without writing | | ||
| | [`--json`](/guides/common-flags) | boolean | `false` | Machine-readable result | | ||
| _See code: [commands/repos.ts › reposPrune](https://github.com/m4ttstack/rt/blob/main/commands/repos.ts)_ | ||
| {/* generated by scripts/gen-docs.ts; edit prose in _partials, not here */} |
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: m4ttstack/rt
Length of output: 1899
🌐 Web query:
GitHub Actions official documentation job-level permissions unspecified permissions contents read actions checkout persist-credentials default💡 Result:
In GitHub Actions, the
GITHUB_TOKENpermissions and theactions/checkoutconfiguration operate as follows: Job-Level Permissions and Defaults When thepermissionskey is unspecified at the job level (and the workflow level), theGITHUB_TOKENinherits default permissions determined by your organization or repository settings [1][2][3]. Repository administrators can configure these defaults to be either "read-only" (typicallycontents: readandpackages: read) or "read/write" (the permissive default) [1][4][5]. If you explicitly define thepermissionsblock within a job, any permissions not listed in that block are set tonone[2][3][4]. For example, specifying onlycontents: readwill result inactions: none,packages: none, and so on [4]. actions/checkout and persist-credentials Theactions/checkoutaction uses thepersist-credentialsinput to control whether the authentication token is configured in the local Git configuration [6][7]. While historically defaulted totrue, recent versions ofactions/checkouthave moved toward defaultingpersist-credentialstofalseto enhance security by reducing the risk of accidentally exposing theGITHUB_TOKEN[8]. When set totrue(the traditional default), the token is persisted in the local Git config to allow authenticated Git commands, and it is automatically removed during post-job cleanup [6][7][9]. When set tofalse, the token is not persisted, preventing the action from performing authenticated Git operations unless an alternative credential method (such as an SSH key) is provided [6][8]. You should consult the documentation for the specific version of theactions/checkoutaction you are using to confirm its default behavior [6][7].Citations:
🌐 Web query:
site:github.com/actions/checkout v4 action.yml persist-credentials default true💡 Result:
In version 4 (v4) of the actions/checkout GitHub Action, the persist-credentials input has a default value of true [1][2]. When persist-credentials is set to true (the default), the action configures the provided authentication token or SSH key into the local git configuration [1][3]. This allows subsequent steps in your workflow to execute authenticated git commands [4][5]. The action automatically removes these credentials during the post-job cleanup phase [4][6]. If you wish to disable this behavior, you can explicitly set persist-credentials to false in your workflow file [4][7].
Citations:
Restrict the workflow token and do not persist it.
Because this workflow executes pull-request code, set explicit read-only permissions and disable the default credential persistence in
actions/checkout@v4.Proposed fix
🧰 Tools
🪛 zizmor (1.29.0)
[warning] 12-34: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents
Source: Linters/SAST tools