Skip to content

Release/v4.0.0 #1

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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Release/v4.0.0 #1

wants to merge 18 commits into from

Conversation

NinjaRocks
Copy link
Member

No description provided.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Comment on lines +11 to +25
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal

run-Lint:

Check warning

Code 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 Autofix

AI 6 days ago

To fix the issue, we will add a permissions block at the root level of the workflow to apply to all jobs. Since the workflow only performs read operations (e.g., checking out code, restoring dependencies, building, testing, and linting), we will set contents: read as the minimal required permission. This ensures that the GITHUB_TOKEN is restricted to read-only access to the repository contents.


Suggested changeset 1
.github/workflows/Master-Build.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/Master-Build.yml b/.github/workflows/Master-Build.yml
--- a/.github/workflows/Master-Build.yml
+++ b/.github/workflows/Master-Build.yml
@@ -4,2 +4,4 @@
 name: master-build
+permissions:
+  contents: read
 
EOF
@@ -4,2 +4,4 @@
name: master-build
permissions:
contents: read

Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +26 to +40
runs-on: ubuntu-latest
env:
github-token: '${{ secrets.GITHUB_TOKEN }}'
steps:
- name: Step-01 Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Step-02 Lint Code Base
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
FILTER_REGEX_INCLUDE: .*src/.*
DEFAULT_BRANCH: master
GITHUB_TOKEN: '${{ env.github-token }}'

Check warning

Code 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 Autofix

AI 6 days ago

To fix the issue, we will add a permissions block to the workflow. Since the workflow only needs to read repository contents and does not perform any write operations, we will set contents: read at the workflow level. This will apply the minimal required permissions to all jobs in the workflow unless overridden by job-specific permissions blocks.


Suggested changeset 1
.github/workflows/Master-Build.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/Master-Build.yml b/.github/workflows/Master-Build.yml
--- a/.github/workflows/Master-Build.yml
+++ b/.github/workflows/Master-Build.yml
@@ -4,2 +4,4 @@
 name: master-build
+permissions:
+  contents: read
 
EOF
@@ -4,2 +4,4 @@
name: master-build
permissions:
contents: read

Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +11 to +26
runs-on: ubuntu-latest
env:
github-token: '${{ secrets.GH_Packages }}'
steps:
- name: Step-01 Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Step-02 Lint Code Base
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
FILTER_REGEX_INCLUDE: .*src/.*
DEFAULT_BRANCH: master
GITHUB_TOKEN: '${{ env.github-token }}'
Build-Test:

Check warning

Code 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 Autofix

AI 6 days ago

To fix the issue, we will add a permissions block at the root level of the workflow to define the minimum required permissions for all jobs. Additionally, we will add job-specific permissions blocks where necessary to grant additional permissions for specific tasks. Based on the workflow's steps:

  • The Run-Lint job only requires contents: read to check out the code and lint it.
  • The Build-Test job also only requires contents: read for building and testing the code.
  • The Package job requires contents: read and packages: write to publish packages to GitHub Packages.

Suggested changeset 1
.github/workflows/PR-CI.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/PR-CI.yml b/.github/workflows/PR-CI.yml
--- a/.github/workflows/PR-CI.yml
+++ b/.github/workflows/PR-CI.yml
@@ -1,2 +1,4 @@
 name: PR-CI
+permissions:
+  contents: read
 on:
@@ -11,2 +13,4 @@
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
     env:
@@ -27,2 +31,4 @@
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
     outputs:
@@ -84,2 +90,5 @@
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      packages: write
     outputs:
EOF
@@ -1,2 +1,4 @@
name: PR-CI
permissions:
contents: read
on:
@@ -11,2 +13,4 @@
runs-on: ubuntu-latest
permissions:
contents: read
env:
@@ -27,2 +31,4 @@
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
@@ -84,2 +90,5 @@
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines 27 to 82
runs-on: ubuntu-latest
outputs:
release_Version: ${{ steps.gitversion.outputs.MajorMinorPatch }}
beta_Version: ${{ steps.gitversion.outputs.nuGetVersion }}
branchName: ${{ steps.gitversion.outputs.branchName }}
env:
working-directory: /home/runner/work/Secure.SAML/Secure.SAML

steps:
- name: Step-01 Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: 5.x

- name: Step-02 Check out Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Step-03 Calculate Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
with:
useConfigFile: true

- name: Step-04 Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x

- name: Step-05 Restore dependencies
run: dotnet restore
working-directory: '${{ env.working-directory }}'

- name: Step-06 Build Version (Beta)
if: ${{ !startsWith(github.head_ref, 'release/')}}
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }}
working-directory: '${{ env.working-directory }}'

- name: Step-06 Build Version (Release)
if: ${{ startsWith(github.head_ref, 'release/')}}
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }}
working-directory: '${{ env.working-directory }}'

- name: Step-07 Test Solution
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal
working-directory: '${{ env.working-directory }}'

- name: Step-08 Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifact
path: ${{env.working-directory}}
retention-days: 1

Package:

Check warning

Code 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 Autofix

AI 6 days ago

To fix the issue, we will add a permissions block at the root level of the workflow file. This block will define the minimum required permissions for the workflow. Based on the actions performed in the workflow, such as checking out code, running tests, and uploading artifacts, the contents: read permission is sufficient. If any job requires additional permissions, they can be defined specifically for that job.


Suggested changeset 1
.github/workflows/PR-CI.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/PR-CI.yml b/.github/workflows/PR-CI.yml
--- a/.github/workflows/PR-CI.yml
+++ b/.github/workflows/PR-CI.yml
@@ -1,2 +1,4 @@
 name: PR-CI
+permissions:
+  contents: read
 on:
EOF
@@ -1,2 +1,4 @@
name: PR-CI
permissions:
contents: read
on:
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines 83 to 104
needs: [Build-Test]
runs-on: ubuntu-latest
outputs:
semVersion: ${{ needs.Build-Release.outputs.semVersion }}
env:
github-token: '${{ secrets.GH_Packages }}'
nuget-token: '${{ secrets.NUGET_API_KEY }}'
working-directory: /home/runner/work/Secure.SAML/Secure.SAML
steps:
- name: Step-01 Retrieve Build Artifacts
uses: actions/download-artifact@v4
with:
name: build-artifact
path: ${{env.working-directory}}

- name: Step-02 Install Github Packages
run: dotnet tool install gpr --global

- name: Step-03 Publish to Github Packages
run: find -name "*.nupkg" -print -exec gpr push -k ${{env.github-token}} {} \;

Release:

Check warning

Code 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: {}

Copilot Autofix

AI 6 days ago

To fix the issue, we will add a permissions block at the root level of the workflow to define the minimal permissions required for all jobs. Additionally, we will add job-specific permissions blocks where elevated permissions are necessary. For example:

  • The Run-Lint job only needs contents: read to check out the code and lint it.
  • The Build-Test job requires contents: read for code checkout and packages: read for accessing packages.
  • The Package and Release jobs require contents: read and packages: write to publish packages.

This approach ensures that each job has the least privileges necessary to perform its tasks.


Suggested changeset 1
.github/workflows/PR-CI.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/PR-CI.yml b/.github/workflows/PR-CI.yml
--- a/.github/workflows/PR-CI.yml
+++ b/.github/workflows/PR-CI.yml
@@ -1,2 +1,4 @@
 name: PR-CI
+permissions:
+  contents: read
 on:
@@ -10,2 +12,4 @@
   Run-Lint:
+    permissions:
+      contents: read
     runs-on: ubuntu-latest
@@ -26,2 +30,5 @@
   Build-Test:
+    permissions:
+      contents: read
+      packages: read
     runs-on: ubuntu-latest
@@ -82,2 +89,5 @@
   Package:
+    permissions:
+      contents: read
+      packages: write
     needs: [Build-Test]
@@ -104,2 +114,5 @@
   Release:
+    permissions:
+      contents: read
+      packages: write
     name: Release to Nuget
EOF
@@ -1,2 +1,4 @@
name: PR-CI
permissions:
contents: read
on:
@@ -10,2 +12,4 @@
Run-Lint:
permissions:
contents: read
runs-on: ubuntu-latest
@@ -26,2 +30,5 @@
Build-Test:
permissions:
contents: read
packages: read
runs-on: ubuntu-latest
@@ -82,2 +89,5 @@
Package:
permissions:
contents: read
packages: write
needs: [Build-Test]
@@ -104,2 +114,5 @@
Release:
permissions:
contents: read
packages: write
name: Release to Nuget
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +105 to +120
name: Release to Nuget
needs: [Package]
if: ${{ startsWith(github.head_ref, 'release/')}}
runs-on: ubuntu-latest
env:
nuget-token: '${{ secrets.NUGET_API_KEY }}'
working-directory: /home/runner/work/Secure.SAML2/Secure.SAML2
steps:
- name: Step-01 Retrieve Build Artifacts
uses: actions/download-artifact@v4
with:
name: build-artifact
path: ${{env.working-directory}}
- name: Step-03 Release to Nuget Org
if: ${{ startsWith(github.head_ref, 'release/')}}
run: dotnet nuget push ${{env.working-directory}}/src/Secure.SAML2/bin/Release/*.nupkg --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json

Check warning

Code 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: {}

Copilot Autofix

AI 6 days ago

To fix the issue, we will add a permissions block to the Release job to explicitly define the minimal permissions required. Based on the job's functionality, it only needs contents: read to retrieve build artifacts and packages: write to push packages to NuGet. This ensures that the GITHUB_TOKEN is restricted to the least privileges necessary for the job.

The permissions block will be added to the Release job definition, and no other changes are required to the workflow.


Suggested changeset 1
.github/workflows/PR-CI.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/PR-CI.yml b/.github/workflows/PR-CI.yml
--- a/.github/workflows/PR-CI.yml
+++ b/.github/workflows/PR-CI.yml
@@ -108,2 +108,5 @@
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      packages: write
     env:     
EOF
@@ -108,2 +108,5 @@
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant