-
Notifications
You must be signed in to change notification settings - Fork 1
Add MiniExcel.Rust NuGet package #3
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
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| name: .NET NuGet | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - '.github/workflows/dotnet-nuget.yml' | ||
| - 'Cargo.lock' | ||
| - 'Cargo.toml' | ||
| - 'miniexcel/**' | ||
| - 'miniexcel-ffi/**' | ||
| - 'dotnet/**' | ||
| - 'scripts/dotnet/**' | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - '.github/workflows/dotnet-nuget.yml' | ||
| - 'Cargo.lock' | ||
| - 'Cargo.toml' | ||
| - 'miniexcel/**' | ||
| - 'miniexcel-ffi/**' | ||
| - 'dotnet/**' | ||
| - 'scripts/dotnet/**' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| PACKAGE_VERSION: 0.1.0-ci.${{ github.run_number }} | ||
|
|
||
| jobs: | ||
| validate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@1.85.0 | ||
| with: | ||
| components: clippy, rustfmt | ||
| - uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 8.0.x | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| key: dotnet-ffi | ||
| - name: Check FFI formatting | ||
| run: cargo fmt --all -- --check | ||
| - name: Check FFI lints | ||
| run: cargo clippy -p miniexcel-ffi --all-targets --locked -- -D warnings | ||
| - name: Test FFI | ||
| run: cargo test -p miniexcel-ffi --all-targets --locked | ||
| - name: Build managed package | ||
| run: dotnet build dotnet/src/MiniExcel.Rust/MiniExcel.Rust.csproj -c Release | ||
|
|
||
| native-package-test: | ||
| name: Test ${{ matrix.rid }} package | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - runner: windows-latest | ||
| rid: win-x64 | ||
| - runner: windows-11-arm | ||
| rid: win-arm64 | ||
| - runner: ubuntu-latest | ||
| rid: linux-x64 | ||
| - runner: ubuntu-24.04-arm | ||
| rid: linux-arm64 | ||
| - runner: macos-15-intel | ||
| rid: osx-x64 | ||
| - runner: macos-latest | ||
| rid: osx-arm64 | ||
| runs-on: ${{ matrix.runner }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@1.85.0 | ||
| - uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 8.0.x | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| key: dotnet-${{ matrix.rid }} | ||
| - name: Build, pack, and consume package | ||
| shell: pwsh | ||
| run: ./scripts/dotnet/Test-Package.ps1 -Rid '${{ matrix.rid }}' -Version $env:PACKAGE_VERSION | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.rid }} | ||
| path: target/nuget/native/${{ matrix.rid }}/* | ||
| if-no-files-found: error | ||
|
|
||
| musl-package-test: | ||
| name: Test ${{ matrix.rid }} package | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - runner: ubuntu-latest | ||
| rid: linux-musl-x64 | ||
| - runner: ubuntu-24.04-arm | ||
| rid: linux-musl-arm64 | ||
| runs-on: ${{ matrix.runner }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@1.85.0 | ||
| with: | ||
| targets: ${{ matrix.rid == 'linux-musl-x64' && 'x86_64-unknown-linux-musl' || 'aarch64-unknown-linux-musl' }} | ||
| - uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 8.0.x | ||
| - uses: mlugg/setup-zig@v2 | ||
| - uses: taiki-e/install-action@v2 | ||
| with: | ||
| tool: cargo-zigbuild | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| key: dotnet-${{ matrix.rid }} | ||
| - name: Build native asset | ||
| shell: pwsh | ||
| run: ./scripts/dotnet/Build-Native.ps1 -Rid '${{ matrix.rid }}' -UseZig -Toolchain 1.85.0 | ||
| - name: Pack one-RID package | ||
| run: >- | ||
| dotnet pack dotnet/src/MiniExcel.Rust/MiniExcel.Rust.csproj | ||
| -c Release | ||
| -o target/nuget/packages | ||
| -p:PackageVersion=${{ env.PACKAGE_VERSION }} | ||
| -p:MiniExcelRustRequireAllNativeAssets=false | ||
| - name: Consume package in Alpine | ||
| run: >- | ||
| docker run --rm | ||
| -v "$GITHUB_WORKSPACE:/work" | ||
| -w /work | ||
| mcr.microsoft.com/dotnet/sdk:8.0-alpine | ||
| sh -lc 'dotnet restore dotnet/tests/MiniExcel.Rust.PackageTests/MiniExcel.Rust.PackageTests.csproj --source target/nuget/packages --source https://api.nuget.org/v3/index.json -p:MiniExcelRustPackageVersion=${{ env.PACKAGE_VERSION }} && dotnet run --project dotnet/tests/MiniExcel.Rust.PackageTests/MiniExcel.Rust.PackageTests.csproj -c Release --no-restore -p:MiniExcelRustPackageVersion=${{ env.PACKAGE_VERSION }}' | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.rid }} | ||
| path: target/nuget/native/${{ matrix.rid }}/* | ||
| if-no-files-found: error | ||
|
|
||
| assemble-package: | ||
| needs: [validate, native-package-test, musl-package-test] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 8.0.x | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| pattern: '*' | ||
| path: target/nuget/native | ||
| - name: Pack complete NuGet | ||
| run: >- | ||
| dotnet pack dotnet/src/MiniExcel.Rust/MiniExcel.Rust.csproj | ||
| -c Release | ||
| -o target/nuget/packages | ||
| -p:PackageVersion=${{ env.PACKAGE_VERSION }} | ||
| - name: Verify package contents | ||
| shell: pwsh | ||
| run: ./scripts/dotnet/Verify-Package.ps1 -PackagePath "target/nuget/packages/MiniExcel.Rust.$env:PACKAGE_VERSION.nupkg" | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: MiniExcel.Rust | ||
| path: target/nuget/packages/MiniExcel.Rust.${{ env.PACKAGE_VERSION }}.*nupkg | ||
| if-no-files-found: error | ||
Oops, something went wrong.
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.
🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
sed -n '1,180p' .github/workflows/dotnet-nuget.ymlRepository: mini-software/MiniExcel-Rust
Length of output: 5665
🌐 Web query:
official actions/checkout README persist-credentials default true💡 Result:
The default value for the persist-credentials input in the official actions/checkout GitHub Action is true [1][2][3]. This setting controls whether the action configures the authentication token or SSH key with the local git configuration [1][2]. When set to true (the default), the credentials are saved to the local git config, which enables subsequent steps in the same job to execute authenticated git commands [1][4]. The action removes these credentials during post-job cleanup [1][2]. While there has been longstanding community discussion regarding security concerns—specifically relating to implicit token access and the potential for credentials to remain exposed—the default behavior remains true in the official action [5][6][7]. Users who wish to opt out of this behavior can explicitly set persist-credentials to false in their workflow configuration [1][2].
Citations:
Sensitive Data Exposure
Reachability: External
Exploitability: Moderate
CWE: CWE-522 — Insufficiently Protected Credentials
Disable persisted checkout credentials.
pull_requestjobs run repository-controlledcargoanddotnetcommands.actions/checkout@v4stores the read-onlyGITHUB_TOKENin local Git configuration by default. Build code can read and exfiltrate this token.Set
persist-credentials: falseon all four checkout steps.Proposed fix
🧰 Tools
🪛 zizmor (1.29.0)
[warning] 35-35: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools