-
-
Notifications
You must be signed in to change notification settings - Fork 7
Fix/docs #151
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
Fix/docs #151
Changes from all commits
bc88cd0
d4edb49
2aec16f
161dd1f
d4aac04
08445d7
450ce54
292b78f
f161e1f
7fbd001
3bc70c8
557be42
e5cc5d7
e6a091d
9e4c664
70a8cb3
56dc720
4160295
b024e11
fb7b729
5b6f1aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: Build | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build Release | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: x86_64-unknown-linux-gnu | ||
|
|
||
| - name: Cache dependencies | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: | | ||
| ~/.cargo/bin/ | ||
| ~/.cargo/registry/index/ | ||
| ~/.cargo/registry/cache/ | ||
| ~/.cargo/git/db/ | ||
| target/ | ||
| key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} | ||
|
|
||
| - name: Build release | ||
| run: cargo build --release --target x86_64-unknown-linux-gnu | ||
|
|
||
| - name: Package binary | ||
| run: | | ||
| cd target/x86_64-unknown-linux-gnu/release | ||
| tar czf ../../../polytorus-linux-amd64.tar.gz polytorus | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: polytorus-linux-amd64 | ||
| path: polytorus-linux-amd64.tar.gz | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,81 @@ | ||||||||||||||||||||||||||||||||
| name: CI | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||
| branches: [ main, develop ] | ||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||
| branches: [ main, develop ] | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||
| CARGO_TERM_COLOR: always | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||
| format: | ||||||||||||||||||||||||||||||||
| name: Auto Format | ||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||
| if: github.event_name == 'pull_request' | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||
| ref: ${{ github.head_ref }} | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Install Rust | ||||||||||||||||||||||||||||||||
| uses: dtolnay/rust-toolchain@stable | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| components: rustfmt | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Run cargo fmt | ||||||||||||||||||||||||||||||||
| run: cargo fmt | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Commit changes | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| git config --local user.email "action@github.com" | ||||||||||||||||||||||||||||||||
| git config --local user.name "GitHub Action" | ||||||||||||||||||||||||||||||||
| git add -A | ||||||||||||||||||||||||||||||||
| if git diff --staged --quiet; then | ||||||||||||||||||||||||||||||||
| echo "No formatting changes needed" | ||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||
| git commit -m "Auto-format code with cargo fmt" | ||||||||||||||||||||||||||||||||
| git push | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| test: | ||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+43
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 10 months ago To fix the problem, we should explicitly set the Steps:
Suggested changeset
1
.github/workflows/ci.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||
| name: Test | ||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Install Rust | ||||||||||||||||||||||||||||||||
| uses: dtolnay/rust-toolchain@stable | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Cache dependencies | ||||||||||||||||||||||||||||||||
| uses: actions/cache@v3 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| path: | | ||||||||||||||||||||||||||||||||
| ~/.cargo/bin/ | ||||||||||||||||||||||||||||||||
| ~/.cargo/registry/index/ | ||||||||||||||||||||||||||||||||
| ~/.cargo/registry/cache/ | ||||||||||||||||||||||||||||||||
| ~/.cargo/git/db/ | ||||||||||||||||||||||||||||||||
| target/ | ||||||||||||||||||||||||||||||||
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Build | ||||||||||||||||||||||||||||||||
| run: cargo build --verbose | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Run tests | ||||||||||||||||||||||||||||||||
| run: cargo test --verbose | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| lint: | ||||||||||||||||||||||||||||||||
| name: Lint | ||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Install Rust | ||||||||||||||||||||||||||||||||
| uses: dtolnay/rust-toolchain@stable | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| components: clippy | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| - name: Run clippy | ||||||||||||||||||||||||||||||||
| run: cargo clippy | ||||||||||||||||||||||||||||||||
|
Comment on lines
+70
to
+81
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 10 months ago To fix the issue, we need to add a
Suggested changeset
1
.github/workflows/ci.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||||||||||||||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 10 months ago
To fix the problem, explicitly set the
permissionskey in the workflow file to restrict theGITHUB_TOKENto the minimum required privileges. Since this workflow only checks out code, builds, and uploads artifacts (and does not push code, create releases, or interact with issues or pull requests), it only needs read access to repository contents. The best way to fix this is to addpermissions: contents: readat the top level of the workflow (just after thename:line and beforeon:), so it applies to all jobs in the workflow. No other changes are needed.