-
Notifications
You must be signed in to change notification settings - Fork 0
test: published package testing #28
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
3 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,36 @@ | ||
| name: 'Test Phase 2: Published Package' | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| workflow_call: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
|
|
||
| test-integration: | ||
| strategy: | ||
| matrix: | ||
| configuration: [Release, Debug] | ||
|
|
||
| # FIX: cannot use ubuntu-latest | ||
| runs-on: ubuntu-22.04 # tip: runs-on can use ${{ matrix.<name> }} | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | ||
| - uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1 | ||
| with: | ||
| dotnet-version: | | ||
| 10.x.x | ||
| 9.x.x | ||
| 8.x.x | ||
| 7.x.x | ||
| 6.x.x | ||
| 5.x.x | ||
|
|
||
| - run: | | ||
| dotnet test ./tests-integration -c ${{ matrix.configuration }} \ | ||
| > test-output.txt | ||
|
|
||
| grep -E " - .*\.dll" test-output.txt >> $GITHUB_STEP_SUMMARY | ||
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 |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ obj | |
| !sandbox | ||
| !src | ||
| !tests | ||
| !integration | ||
| !tests-integration | ||
|
|
||
| !.gitignore | ||
| !Directory.Build.props | ||
|
|
||
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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: sator-imaging/ZeroSerializer
Length of output: 309
🌐 Web query:
actions/checkout persist-credentials default true GITHUB_TOKEN local git config v4💡 Result:
In actions/checkout@v4, the persist-credentials input defaults to true [1][2]. When enabled, the action configures the provided authentication token (such as GITHUB_TOKEN) or SSH key within the local git configuration [3][1]. This allows subsequent steps in your workflow to execute authenticated git commands [3][1]. Specifically, for v4, the credentials are written into the repository's.git/config file, typically as an http.https://github.com/.extraheader basic-auth value [4]. Because these credentials reside within the.git directory, they may be inadvertently exposed if the workspace (including the.git folder) is archived and uploaded as a workflow artifact [5][4]. The action automatically removes these credentials during the post-job cleanup phase [3][1]. However, if you do not require authenticated git operations in subsequent steps or wish to avoid the risk of credential exposure via artifacts, you can opt out by setting persist-credentials to false [3][5]: - uses: actions/checkout@v4 with: persist-credentials: false
Citations:
persist-credentials: falseon checkout steps cli/go-gh#225🏁 Script executed:
Repository: sator-imaging/ZeroSerializer
Length of output: 2419
🌐 Web query:
GitHub Actions workflow permissions default GITHUB_TOKEN repository settings actions/checkout contents: read token permissions💡 Result:
In GitHub Actions, the GITHUB_TOKEN is an automatically generated, short-lived authentication token used to interact with the GitHub API within your workflow jobs [1][2]. Default Permissions The default permissions of the GITHUB_TOKEN are determined by repository or organization-level settings [3]. Repository administrators can choose between two default modes: 1. Permissive: Grants read/write access to all scopes (historically the default). 2. Restricted: Grants read-only access to contents and packages [3][1]. When a workflow runs, if no permissions are explicitly defined, it inherits these default repository settings [4]. As a security best practice, GitHub recommends configuring your repository to use the restricted default and explicitly granting only the minimum required permissions within your workflow files [2][5]. Using the Permissions Key You can override default settings by using the permissions key in your workflow YAML file, either at the workflow level or for individual jobs [1][6]. When you explicitly define any permission, all other permissions are automatically set to 'none', except for the metadata scope, which always retains read access [6]. Example for actions/checkout The actions/checkout action requires the contents scope to fetch your repository [7][8]. To follow the principle of least privilege, it is recommended to explicitly set this permission in your workflow: jobs: build: runs-on: ubuntu-latest permissions: contents: read steps: - uses: actions/checkout@v4 If your workflow requires writing to the repository (e.g., pushing tags, updating files), you must grant contents: write [4]. If you do not provide explicit permissions, the job will rely on the repository's configured defaults, which may be more permissive than your workflow requires [4].
Citations:
Restrict the GitHub token before executing tests.
actions/checkoutpersistsGITHUB_TOKENin the local Git configuration by default, and this job then executes checked-out code withdotnet test. Since the workflow does not set explicitpermissions, it also inherits repository-default token permissions. Setpermissions: contents: readand disable persisted checkout credentials for this workflow.Apply least-privilege token settings
🧰 Tools
🪛 zizmor (1.29.0)
[warning] 21-21: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools