-
Notifications
You must be signed in to change notification settings - Fork 2
sync #693
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
sync #693
Changes from all commits
ae86e1e
f34c63d
fe39de9
982e619
9165326
1dfc047
3f20410
584ef2a
b8ca765
d8ffe21
8ec61f9
982f8b4
514dd07
214587a
3fc19c2
73af31d
e1c77e6
266d05e
16db2c4
1ee71a9
90b5733
576558a
00e434b
e8e04bf
379321b
cbb35b8
8bc2b27
3b52a81
e95e178
7d17ce5
32812ac
9d53714
6f9677e
e0a873a
6b31ade
72b6bfb
f6479ba
83bf4f3
e0e5bfc
7061270
b5512e0
c781076
9786805
35a5a4d
e1affdf
1ee969c
bf22ec0
9d46f24
12252a4
8f77a03
8b5d85a
9edc992
7f6c935
33d9557
c588578
8e8be62
6ef2485
8dd828a
4a163c0
985fd3d
4a0c3ee
35f3510
becaa0b
c9dbd3b
503f5f9
b5b8bb9
85d1984
96abade
20933d2
36b68a7
5c05964
f5c1cd8
1511b5a
f44ee69
bb72fea
942bac1
f7801f0
cf700e4
5ffc0d7
e12466e
87bd1de
0e95f2d
5f40d10
32b7f9b
724d3a4
ff54708
c3b7fc5
b86e5b4
145ca6c
75d7b02
34218af
75f9eb6
940f294
cade552
8076ca2
bb14ef8
db1dc59
0ad1c88
10007f5
2383e8e
55c75b4
fbd70fe
5173851
156f54e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,115 +1,51 @@ | ||
| # This workflow uses actions that are not certified by GitHub. | ||
| # They are provided by a third-party and are governed by | ||
| # separate terms of service, privacy policy, and support | ||
| # documentation. | ||
|
|
||
| # This workflow will build, test, sign and package a WPF or Windows Forms desktop application | ||
| # built on .NET Core. | ||
| # To learn how to migrate your existing application to .NET Core, | ||
| # refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework | ||
| # | ||
| # To configure this workflow: | ||
| # | ||
| # 1. Configure environment variables | ||
| # GitHub sets default environment variables for every workflow run. | ||
| # Replace the variables relative to your project in the "env" section below. | ||
| # | ||
| # 2. Signing | ||
| # Generate a signing certificate in the Windows Application | ||
| # Packaging Project or add an existing signing certificate to the project. | ||
| # Next, use PowerShell to encode the .pfx file using Base64 encoding | ||
| # by running the following Powershell script to generate the output string: | ||
| # | ||
| # $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte | ||
| # [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt' | ||
| # | ||
| # Open the output file, SigningCertificate_Encoded.txt, and copy the | ||
| # string inside. Then, add the string to the repo as a GitHub secret | ||
| # and name it "Base64_Encoded_Pfx." | ||
| # For more information on how to configure your signing certificate for | ||
| # this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing | ||
| # | ||
| # Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key". | ||
| # See "Build the Windows Application Packaging project" below to see how the secret is used. | ||
| # | ||
| # For more information on GitHub Actions, refer to https://github.com/features/actions | ||
| # For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications, | ||
| # refer to https://github.com/microsoft/github-actions-for-desktop-apps | ||
|
|
||
| name: .NET Core Desktop | ||
| name: CSharpBible CI3 | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "master" ] | ||
| paths: | ||
| - "CSharpBible/**" | ||
| pull_request: | ||
| branches: [ "master" ] | ||
| paths: | ||
| - "CSharpBible/**" | ||
|
|
||
| jobs: | ||
|
|
||
| build: | ||
|
|
||
| strategy: | ||
| matrix: | ||
| configuration: [Debug, Release] | ||
|
|
||
| runs-on: windows-latest # For a list of available runner types, refer to | ||
| # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | ||
|
|
||
| env: | ||
| Solution_Name: CSharpBible.sln # Replace with your solution name, i.e. MyWpfApp.sln. | ||
| Test_Project_Path: Tests\Test.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. | ||
| Wap_Project_Directory: CSharpBible # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. | ||
| Wap_Project_Path: CSharpBible # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. | ||
|
|
||
| build-test: | ||
| runs-on: windows-latest | ||
| defaults: | ||
| run: | ||
| working-directory: CSharpBible | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| # Install the .NET Core workload | ||
| - name: Install .NET Core | ||
| uses: actions/setup-dotnet@v3 | ||
| with: | ||
| dotnet-version: 6.0.x | ||
|
|
||
| # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild | ||
| - name: Setup MSBuild.exe | ||
| uses: microsoft/setup-msbuild@v1.0.2 | ||
|
|
||
| # Execute all unit tests in the solution | ||
| - name: Execute unit tests | ||
| run: dotnet test | ||
|
|
||
| # Restore the application to populate the obj folder with RuntimeIdentifiers | ||
| - name: Restore the application | ||
| run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration | ||
| env: | ||
| Configuration: ${{ matrix.configuration }} | ||
|
|
||
| # Decode the base 64 encoded pfx and save the Signing_Certificate | ||
| - name: Decode the pfx | ||
| run: | | ||
| $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") | ||
| $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx | ||
| [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) | ||
|
|
||
| # Create the app package by building and packaging the Windows Application Packaging project | ||
| - name: Create the app package | ||
| run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} | ||
| env: | ||
| Appx_Bundle: Always | ||
| Appx_Bundle_Platforms: x86|x64 | ||
| Appx_Package_Build_Mode: StoreUpload | ||
| Configuration: ${{ matrix.configuration }} | ||
|
|
||
| # Remove the pfx | ||
| - name: Remove the pfx | ||
| run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx | ||
|
|
||
| # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact | ||
| - name: Upload build artifacts | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: MSIX Package | ||
| path: ${{ env.Wap_Project_Directory }}\AppPackages | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET 8.0 | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: "8.0.x" | ||
|
|
||
| - name: Remove private projects | ||
| run: | | ||
| dotnet sln CSharpBible.sln remove "Mobile/MauiApp1/MauiApp1.csproj" | ||
| dotnet sln CSharpBible.sln remove "Simulation/AGVFktTests/AGVFktTests.csproj" | ||
| dotnet sln CSharpBible.sln remove "Simulation/AGVFkt/AGVFkt.csproj" | ||
| dotnet sln CSharpBible.sln remove "DB/ADO_Test/ADO_Test.csproj" | ||
| dotnet sln CSharpBible.sln remove "Libraries/CSFreeVision_/CSFreeVision.csproj" | ||
| dotnet sln CSharpBible.sln remove "Mobile/DXMauiApp1/DXMauiApp1.csproj" | ||
| dotnet sln CSharpBible.sln remove "Web/MyComponent/Client/MyComponent.Client.csproj" | ||
| dotnet sln CSharpBible.sln remove "Web/MyComponent/Server/MyComponent.Server.csproj" | ||
| dotnet sln CSharpBible.sln remove "Web/MyComponent/Shared/MyComponent.csproj" | ||
| dotnet sln CSharpBible.sln remove "WinUI/App1/App1/App1.csproj" | ||
| dotnet sln CSharpBible.sln remove "App2/App2.csproj" | ||
| dotnet sln CSharpBible.sln remove "../PackageDwnLd.csproj" | ||
| dotnet sln CSharpBible.sln remove "Web/BlazorApp1/BlazorApp1.csproj" | ||
| dotnet sln CSharpBible.sln remove "Web/WebApp1/BlazorApp2/BlazorApp2.csproj" | ||
| dotnet sln CSharpBible.sln remove "Web/WebApp1/WebApplication1/WebApplication1/WebApplication1.csproj" | ||
|
|
||
| - name: Restore | ||
| run: dotnet restore CSharpBible.sln -p:TargetFramework=net8.0-windows | ||
|
|
||
| - name: Build | ||
| run: dotnet build CSharpBible.sln --configuration Release --no-restore -p:TargetFramework=net8.0-windows | ||
|
|
||
| - name: Test | ||
| run: dotnet test CSharpBible.sln --configuration Release --no-build --verbosity normal -p:TargetFramework=net8.0-windows | ||
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | |||||||||||||||||||||||||||||
| name: TestStatemens CI0 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||
| push: | |||||||||||||||||||||||||||||
| paths: | |||||||||||||||||||||||||||||
| - "TestStatements/**" | |||||||||||||||||||||||||||||
| pull_request: | |||||||||||||||||||||||||||||
| paths: | |||||||||||||||||||||||||||||
| - "TestStatements/**" | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||
| build-test: | |||||||||||||||||||||||||||||
| runs-on: windows-latest | |||||||||||||||||||||||||||||
| defaults: | |||||||||||||||||||||||||||||
| run: | |||||||||||||||||||||||||||||
| working-directory: TestStatements | |||||||||||||||||||||||||||||
| steps: | |||||||||||||||||||||||||||||
| - name: Checkout | |||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Setup .NET 8.0 | |||||||||||||||||||||||||||||
| uses: actions/setup-dotnet@v4 | |||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||
| dotnet-version: "8.0.x" | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Remove private projects | |||||||||||||||||||||||||||||
| run: | | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Restore | |||||||||||||||||||||||||||||
| run: dotnet restore TestStatements.sln -p:TargetFramework=net8.0-windows | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| - name: Build | |||||||||||||||||||||||||||||
| run: dotnet build TestStatements.sln --configuration Release --no-restore -p:TargetFramework=net8.0-windows | |||||||||||||||||||||||||||||
| - name: Test | |||||||||||||||||||||||||||||
| run: dotnet test TestStatements.sln --configuration Release --no-build --verbosity normal -p:TargetFramework=net8.0-windows | |||||||||||||||||||||||||||||
|
Comment on lines
+13
to
+35
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 5 months ago In general, the fix is to add an explicit Concretely, in
Suggested changeset
1
.github/workflows/Teststatements.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Refresh and try again.
|
|||||||||||||||||||||||||||||
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 5 months ago
In general, the fix is to define an explicit
permissionsblock for the workflow or individual jobs, granting only the minimal scopes required. For this workflow, the job only needs to read repository contents to allowactions/checkoutto fetch the code; it does not appear to need any write permissions or additional scopes.The single best fix with no functional change is to add a root-level
permissionssection that applies to all jobs, immediately below thename(oron) block. Setcontents: readas recommended by CodeQL. No imports or additional methods are needed; this is purely a YAML configuration change within.github/workflows/CSharpBible.yml.Concretely: in
.github/workflows/CSharpBible.yml, after line 1 (name: CSharpBible CI3) insert apermissions:block specifyingcontents: read. This will constrain theGITHUB_TOKENfor thebuild-testjob (and any future jobs without their ownpermissionsblock) to read-only access to repository contents.