Skip to content
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

DevSecOps pipeline with GitHub Actions #760

Merged
merged 239 commits into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from 237 commits
Commits
Show all changes
239 commits
Select commit Hold shift + click to select a range
1a91252
add Dependabot with GHA and both .NET dependency sources as ecosystems
aleks-ivanov Jan 12, 2021
f32c823
add Dependabot with GHA and both .NET dependency sources as ecosystems
aleks-ivanov Jan 12, 2021
2057599
add CodeQL
aleks-ivanov Jan 12, 2021
509661b
add CodeQL
aleks-ivanov Jan 12, 2021
5de6591
increase page-size and change build configuration to Debug
aleks-ivanov Jan 12, 2021
573839c
test Release build configuration
aleks-ivanov Jan 12, 2021
48de8a5
Add CodeQL
aleks-ivanov Jan 12, 2021
c34f41a
add Debug and remove explicit language declaration
aleks-ivanov Jan 13, 2021
e6b7d85
add comment for the pagefile step and clean up the workflow
aleks-ivanov Jan 13, 2021
aeace53
create CI-CD_DOCUMENTATION.md and add Dependabot entry
aleks-ivanov Jan 13, 2021
c2305bf
Merge pull request #1 from AleksIvanovSinglet/feature/dependabot
kulov Jan 15, 2021
bbd56b0
Merge pull request #2 from AleksIvanovSinglet/feature/codeql
kulov Jan 15, 2021
234b9c5
Merge pull request #3 from AleksIvanovSinglet/feature/dependabot-docs
kulov Jan 15, 2021
80acb42
Add SonarCloud. (#4)
szlatkow Jan 15, 2021
566e61c
add CodeQL entry to documentation
aleks-ivanov Jan 18, 2021
98e9093
Merge pull request #5 from AleksIvanovSinglet/feature/codeql-docs
kulov Jan 18, 2021
d5dc611
add Manual workflow run entry to documentation
aleks-ivanov Jan 18, 2021
1eec010
correct step three of Manual run entry
aleks-ivanov Jan 18, 2021
d82ae8c
Merge pull request #6 from AleksIvanovSinglet/feature/manual-run-docs
kulov Jan 18, 2021
35409ab
add initial entry for the release sequence
aleks-ivanov Jan 19, 2021
fe00710
add code scanning alerts bulk dismissal yml and test jq installation
aleks-ivanov Jan 22, 2021
3cf21c3
test jq installation
aleks-ivanov Jan 22, 2021
89970fe
test bulk alert dismissal script
aleks-ivanov Jan 22, 2021
aeca8dd
test secrets as variable vault
aleks-ivanov Jan 22, 2021
8027811
remove push from workflow triggers
aleks-ivanov Jan 22, 2021
a857401
Merge pull request #8 from AleksIvanovSinglet/feature/csa-bulk-dismissal
kulov Jan 22, 2021
763f49b
Merge pull request #7 from AleksIvanovSinglet/feature/release-init-docs
kulov Jan 22, 2021
6d88de0
Delete CI-CD Documentation.md
kulov Jan 22, 2021
4c29e1b
add documentation entry for the 'Code scanning alerts bulk dismissal'
aleks-ivanov Jan 25, 2021
645167b
clear the PAT step
aleks-ivanov Jan 25, 2021
8c89b9d
add some clarifications
aleks-ivanov Jan 25, 2021
1143696
fix a syntactical mistake in CodeQL entry
aleks-ivanov Jan 25, 2021
e33be22
Merge pull request #9 from AleksIvanovSinglet/feature/csa-dismissal-docs
kulov Jan 26, 2021
f039c75
Test sonarcloud without GITHUB_TOKEN.
szlatkow Jan 26, 2021
cd634b2
Update GITHUB_TOKEN
szlatkow Jan 26, 2021
4485bc9
Update actions/cache@v1 to v2.
szlatkow Jan 26, 2021
4ac8553
remove Release entry from docs
aleks-ivanov Jan 26, 2021
8451f6f
Merge pull request #11 from AleksIvanovSinglet/feature/release-doc-re…
kulov Jan 26, 2021
b26569a
Change SONAR_ACCESS_TOKEN to SONAR_GITHUB_TOKEN.
szlatkow Jan 26, 2021
87f51c9
Change the name frin SIBAR_ACCESS_TOKEN to SONAR_GITHUB_TOKEN.
szlatkow Jan 26, 2021
f813926
Merge pull request #12 from szlatkow/feature/sonarcloud-test-authenti…
kulov Jan 26, 2021
55a555a
Merge pull request #13 from szlatkow/feature/sonarcloud-cache-update-v2
kulov Jan 26, 2021
98450c4
Skip running SonarCloud on PR. (#14)
szlatkow Jan 26, 2021
c0b599d
fix a syntax mistake in the CSABR entry
aleks-ivanov Jan 26, 2021
5721654
Add value in the documentation file about SonarCloud
szlatkow Jan 26, 2021
e923c32
Merge pull request #15 from AleksIvanovSinglet/feature/fix-syntax-mis…
kulov Jan 26, 2021
2d6a6d8
correct the https miss in the credits and add credits where needed
aleks-ivanov Jan 27, 2021
f3558c6
Update the changes requested from the last PR.
szlatkow Jan 27, 2021
dc492d4
Change steps counting from numbers to "-".
szlatkow Jan 27, 2021
8257caa
Remove the dots from the SonarCloud documentation.
szlatkow Jan 27, 2021
e9cc89c
improve CSABD pipeline
aleks-ivanov Jan 29, 2021
a78148b
Merge pull request #5 from AleksIvanovSinglet/feature/improved-csabd
aleks-ivanov Jan 29, 2021
d22a58a
test
aleks-ivanov Jan 29, 2021
442ebcb
Merge pull request #16 from szlatkow/feature/add-documentation-for-so…
kulov Jan 29, 2021
1a66696
test2
aleks-ivanov Jan 29, 2021
efc4204
Merge branch 'devsecops' into feature/https-correction
kulov Jan 29, 2021
d383369
Merge pull request #17 from AleksIvanovSinglet/feature/https-correction
kulov Jan 29, 2021
8a189a1
test3
aleks-ivanov Jan 29, 2021
faa3d54
test4
aleks-ivanov Jan 29, 2021
4ce7ac9
test5
aleks-ivanov Jan 29, 2021
85bb26d
test6
aleks-ivanov Jan 29, 2021
1b9be5f
test7
aleks-ivanov Jan 29, 2021
54992a9
test8
aleks-ivanov Jan 29, 2021
7469c75
test9
aleks-ivanov Jan 29, 2021
3a0bf02
test10
aleks-ivanov Jan 29, 2021
093d723
test11
aleks-ivanov Jan 29, 2021
39a0b44
test12
aleks-ivanov Jan 29, 2021
3b409dd
test13
aleks-ivanov Jan 29, 2021
4f14f92
test14
aleks-ivanov Jan 29, 2021
d8b063d
improve CSABD pipeline
aleks-ivanov Jan 29, 2021
240a429
improve CSABD pipeline
aleks-ivanov Jan 29, 2021
f85c270
Merge branch 'devsecops' into feature/improved-csabd
aleks-ivanov Jan 29, 2021
03ff0b0
Merge branch 'master' into feature/improved-csabd
aleks-ivanov Jan 29, 2021
e5193ca
Merge pull request #18 from AleksIvanovSinglet/feature/improved-csabd
kulov Jan 29, 2021
0b10b17
change all 'your project' to 'the project'
aleks-ivanov Feb 1, 2021
f4434ee
Merge pull request #19 from AleksIvanovSinglet/feature/the-project
kulov Feb 1, 2021
f126341
add an entry for the CSABD description filtering to the docs
aleks-ivanov Feb 2, 2021
8c691ba
correct pipeline name
aleks-ivanov Feb 2, 2021
78b0483
Merge pull request #20 from AleksIvanovSinglet/feature/improve-csabd-…
kulov Feb 2, 2021
cbeb9d7
Merge pull request #21 from AleksIvanovSinglet/feature/correct-pipeli…
kulov Feb 2, 2021
dbe1265
Test if the package building is working.
szlatkow Feb 3, 2021
10fe1d3
upgrade versions on msbuild and dotnet.
szlatkow Feb 3, 2021
be8096c
add env for solution name.
szlatkow Feb 3, 2021
751e7b9
Add TargetPlatform.
szlatkow Feb 3, 2021
3dbabfa
eddit the env for the build process.
szlatkow Feb 3, 2021
d9eacd7
change the configuration.
szlatkow Feb 3, 2021
8807a20
replace the run step on the build
szlatkow Feb 3, 2021
a0aab2c
use different env for solution name
szlatkow Feb 3, 2021
c0fe4b3
use Project_Path instead of Solution _Path in the build step.
szlatkow Feb 3, 2021
bb3e0a8
disable package signing.
szlatkow Feb 3, 2021
9987aed
et Appx_Bundle_Platforms: x86|x64 and turn off the trigger for other …
szlatkow Feb 3, 2021
698c126
set target platform .
szlatkow Feb 3, 2021
8539737
add matrix targetplatform
szlatkow Feb 3, 2021
45d45e2
ussing project instead of solution for the build process.
szlatkow Feb 3, 2021
63f7813
switched off the trigger for main.yml and changed the path of the pac…
szlatkow Feb 3, 2021
6bf65ff
change the path for the package.
szlatkow Feb 3, 2021
506276a
run the ls command
szlatkow Feb 4, 2021
d01730b
use Get-ChildItem -Depth 1 insted of gci.
szlatkow Feb 4, 2021
a38d1db
use Depth 5
szlatkow Feb 4, 2021
3a28a8b
change depth to 20
szlatkow Feb 4, 2021
ef4ce15
change directory of the msix package.
szlatkow Feb 4, 2021
db42979
use the github demo signing,
szlatkow Feb 4, 2021
0d060f6
Change build mode to StoreUpload
szlatkow Feb 8, 2021
b9f6f34
Change the "Appx_Boundle:" to Always.
szlatkow Feb 8, 2021
2aaca39
replace the project file with solution for the build.
szlatkow Feb 8, 2021
6581729
echo all env.
szlatkow Feb 8, 2021
47c3349
build without signing
szlatkow Feb 8, 2021
d2b0d5f
upload the working directory as a artifact.
szlatkow Feb 9, 2021
57cadc4
Add AppxPackageDir.
szlatkow Feb 9, 2021
5b3b79f
set shell to powershell
szlatkow Feb 9, 2021
5034d82
fix syntax in build step.
szlatkow Feb 9, 2021
d38cb46
change appxpackageDir
szlatkow Feb 9, 2021
058c9f1
change the path for build artifact
szlatkow Feb 9, 2021
283e914
test full template
szlatkow Feb 9, 2021
29cd3f4
Add RuntimeIdentifier
szlatkow Feb 9, 2021
9953df0
change the name from cd to ci
szlatkow Feb 9, 2021
1b4a134
Fix identation for AppxBundle
szlatkow Feb 9, 2021
de84b84
Merge branch 'master' of https://github.com/pipeline-foundation/Notep…
aleks-ivanov Feb 9, 2021
3e90ba7
Add numbering for the tools.
szlatkow Feb 9, 2021
3edfc7f
upload artfifacts.
szlatkow Feb 9, 2021
9b7a8bb
integrate the build package step in main.yml
szlatkow Feb 9, 2021
5d34ea4
Remove RuntimeIdentifier.
szlatkow Feb 9, 2021
dafdaa5
Change Solution_Path to Solution_Name.
szlatkow Feb 9, 2021
4beaafa
Merge pull request #22 from szlatkow/feature/fix-documentation-numbering
kulov Feb 9, 2021
1cb921f
clear build
szlatkow Feb 10, 2021
6e59682
Build msix boundle without signing.
szlatkow Feb 10, 2021
9170279
Change build and restore env:Solution_Name.
szlatkow Feb 10, 2021
df030b7
Merge branch 'devsecops' of https://github.com/szlatkow/Notepads into…
szlatkow Feb 10, 2021
91f5722
fix requested changes.
szlatkow Feb 11, 2021
326611a
fix requested changes.
szlatkow Feb 11, 2021
8013b0e
Merge pull request #23 from szlatkow/feature/upload-msixboundle-as-ar…
kulov Feb 11, 2021
effe739
fix requested changes.
szlatkow Feb 12, 2021
7ff1a0a
Fix indenting for Pipeline credits.
szlatkow Feb 12, 2021
d4e4b9e
Fix identation for Pipeline credentials.
szlatkow Feb 12, 2021
d45fd18
Merge pull request #24 from szlatkow/feature/upload-msixboundle-as-ar…
kulov Feb 12, 2021
b716017
create release, add versioning from Package.appxmanifest, upload msix…
aleks-ivanov Feb 12, 2021
f642dcd
test XML parser action
aleks-ivanov Feb 15, 2021
840a8b5
test XML parser action
aleks-ivanov Feb 15, 2021
abcf5f8
test XML parser action
aleks-ivanov Feb 15, 2021
5db20c4
test XML parser action
aleks-ivanov Feb 15, 2021
c7226da
test XML parser action
aleks-ivanov Feb 15, 2021
03c2be8
test XML parser action
aleks-ivanov Feb 15, 2021
96e8816
test XML parser action
aleks-ivanov Feb 15, 2021
3b02dee
test XML parser action
aleks-ivanov Feb 15, 2021
2e80bcd
test XML parser action
aleks-ivanov Feb 15, 2021
74e07af
test XML parser action
aleks-ivanov Feb 15, 2021
a286562
test XML parser action
aleks-ivanov Feb 15, 2021
129b2c5
test XML parser action
aleks-ivanov Feb 15, 2021
c5a5db7
test XML parser action
aleks-ivanov Feb 15, 2021
86a5729
test XML parser action
aleks-ivanov Feb 15, 2021
adcca35
test XML parser action
aleks-ivanov Feb 15, 2021
114df6e
test XML parser action
aleks-ivanov Feb 15, 2021
7193ee4
test XML parser action
aleks-ivanov Feb 15, 2021
b927582
test XML parser action
aleks-ivanov Feb 15, 2021
3241741
test XML parser action
aleks-ivanov Feb 15, 2021
90a4c4c
test XML parser action
aleks-ivanov Feb 15, 2021
21da8eb
test XML parser action
aleks-ivanov Feb 15, 2021
8236893
test XML parser action
aleks-ivanov Feb 15, 2021
00ea017
remove XML parser action
aleks-ivanov Feb 15, 2021
8a72f2c
test xPath
aleks-ivanov Feb 15, 2021
7047afb
test xPath
aleks-ivanov Feb 15, 2021
4fa5b85
test xPath
aleks-ivanov Feb 15, 2021
96cd3bd
test xPath
aleks-ivanov Feb 15, 2021
ea6d595
test Select-Xml
aleks-ivanov Feb 15, 2021
abe6c4c
test Select-Xml
aleks-ivanov Feb 15, 2021
31696be
test Select-Xml
aleks-ivanov Feb 15, 2021
8c49dbb
test Select-Xml
aleks-ivanov Feb 15, 2021
86ccc9d
test
aleks-ivanov Feb 15, 2021
1510768
test
aleks-ivanov Feb 15, 2021
d2f6547
test
aleks-ivanov Feb 15, 2021
677f7c1
test create release with powershell
aleks-ivanov Feb 15, 2021
04ce8ed
test create release with powershell
aleks-ivanov Feb 15, 2021
249abe7
create release with Powershell
aleks-ivanov Feb 15, 2021
2745b16
turn push tag step to powershell
aleks-ivanov Feb 15, 2021
10d452a
Merge pull request #25 from aleks-ivanov/feature/create-release
kulov Feb 15, 2021
1ccfd38
add the discussed improvements for the release sequence
aleks-ivanov Feb 16, 2021
48fa3aa
Merge pull request #26 from aleks-ivanov/feature/improve-release
kulov Feb 16, 2021
700fec9
add certification signing from Base64 to package build process
aleks-ivanov Feb 17, 2021
e5172c0
remove multi-line script for Initialize SonarCloud scanner step
aleks-ivanov Feb 17, 2021
ff5a85d
test new SonarCloud implementation
aleks-ivanov Feb 17, 2021
a6cac60
test SonarCloud classic implementation
aleks-ivanov Feb 17, 2021
fbfa0f6
test SonarCloud classic implementation
aleks-ivanov Feb 17, 2021
51e499a
test SonarCloud classic implementation
aleks-ivanov Feb 17, 2021
db9ece7
test SonarCloud classic implementation
aleks-ivanov Feb 17, 2021
ca41f10
test SonarCloud classic implementation
aleks-ivanov Feb 17, 2021
b09791d
test SonarCloud classic implementation
aleks-ivanov Feb 17, 2021
8e118e4
complete package signing
aleks-ivanov Feb 17, 2021
778307c
made two of the SonarCloud steps more readable
aleks-ivanov Feb 17, 2021
5dbe9c1
test package signing limited to push
aleks-ivanov Feb 18, 2021
beec2b3
test package signing limited to push
aleks-ivanov Feb 18, 2021
7f3048f
test package signing limited to push
aleks-ivanov Feb 18, 2021
6f62d03
Merge pull request #27 from aleks-ivanov/feature/add-cert-signing
kulov Feb 18, 2021
4fa0315
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
a35d143
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
a5ee73d
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
8f4a188
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
2b3e2be
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
82e872e
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
53ae48a
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
1b47986
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
2ffef61
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
454cb12
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
8c5c6c5
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
6746a44
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
699bc87
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
783250c
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
eefabad
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
c70f1a5
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
2696e2a
test steps' conditionals handler step
aleks-ivanov Feb 18, 2021
347fd06
create 'Steps' conditionals handler' step
aleks-ivanov Feb 18, 2021
3400853
Merge pull request #28 from aleks-ivanov/feature/improve-steps-condit…
kulov Feb 18, 2021
03f26b8
draft Create Release documentation entry
aleks-ivanov Feb 19, 2021
b4253ec
complete Create Release sequence documentation entry
aleks-ivanov Feb 19, 2021
64602e4
correct PowerShell name
aleks-ivanov Feb 19, 2021
ed8cdf7
add the tag itself for its description
aleks-ivanov Feb 19, 2021
018e31e
Merge pull request #29 from aleks-ivanov/feature/create-release-docs
kulov Feb 19, 2021
7ae1fa2
made all steps in codeql.yml and main.yml per our conventions
aleks-ivanov Feb 22, 2021
f753af0
made all steps in codeql.yml and main.yml per our conventions
aleks-ivanov Feb 22, 2021
94feaba
decrease the complexity of the CSABD setup and update documentation f…
aleks-ivanov Feb 22, 2021
8d6746f
link Configure SonarCloud project PAT creation step to 'How to create…
aleks-ivanov Feb 22, 2021
7b1b929
Update CI-CD_DOCUMENTATION.md
aleks-ivanov Feb 22, 2021
205a57b
Update CI-CD_DOCUMENTATION.md
aleks-ivanov Feb 22, 2021
c4cc391
Update CI-CD_DOCUMENTATION.md
aleks-ivanov Feb 22, 2021
12f6f3d
Merge pull request #31 from aleks-ivanov/feature/codeql-improvements
kulov Feb 23, 2021
27b4e2b
switch shell:powershell to pwsh
aleks-ivanov Feb 23, 2021
3527a2d
Merge pull request #32 from aleks-ivanov/feature/pwsh-shell
kulov Feb 23, 2021
87a2992
Merge pull request #24 from aleks-ivanov/devsecops
aleks-ivanov Feb 23, 2021
9a0df5d
add owner's requested changes
aleks-ivanov Feb 25, 2021
59145e3
Merge pull request #29 from aleks-ivanov/feature/owner-feedback
aleks-ivanov Feb 25, 2021
dd008c3
correct msixbundle path
aleks-ivanov Feb 25, 2021
2ac6467
Merge branch 'master' of https://github.com/aleks-ivanov/Notepads int…
aleks-ivanov Mar 19, 2021
8180b6c
Merge pull request #37 from aleks-ivanov/devsecops
aleks-ivanov Mar 19, 2021
890261f
add latest feedback changes
aleks-ivanov Mar 19, 2021
91292fd
Merge pull request #38 from aleks-ivanov/feature/feedback
aleks-ivanov Mar 19, 2021
70d4839
sync devsecops with master; move AppCenterSecret to Package.targets
aleks-ivanov Mar 22, 2021
c3a0194
Merge branch 'master' of https://github.com/pipeline-foundation/Notep…
aleks-ivanov Mar 23, 2021
6d3aa7d
Add publish to WS automation and documentation for it AB#369 (#39)
aleks-ivanov Mar 24, 2021
01ed6e3
change publish-to-store action ref (#40)
aleks-ivanov Mar 24, 2021
0c8833b
update app registration step (#41)
aleks-ivanov Mar 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: "github-actions"
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "nuget"
# location of package manifests
directory: "/src/Notepads"
schedule:
interval: "daily"

- package-ecosystem: "nuget"
# location of package manifests
directory: "/src/Notepads.Controls"
schedule:
interval: "daily"

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
73 changes: 73 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CodeQL Analysis

on:
push:
pull_request:
schedule:
- cron: '0 8 * * *'

jobs:
analyze:
name: codeql-analysis
runs-on: windows-latest
strategy:
matrix:
configuration: [ Production ]
env:
SOLUTION_NAME: src\Notepads.sln
PROJECT_PATH: src\Notepads\Notepads.csproj
CONFIGURATION: ${{ matrix.configuration }}
steps:
- name: Checkout repository
id: checkout_repo
uses: actions/checkout@v2

# Due to the insufficient memory allocated by default, CodeQL sometimes requires more to be manually allocated
- name: Configure Pagefile
id: config_pagefile
uses: al-cheb/[email protected]
with:
minimum-size: 8GB
maximum-size: 32GB
disk-root: "D:"

- name: Setup MSBuild
id: setup_msbuild
uses: microsoft/setup-msbuild@v1

- name: Restore application
id: restore_app
shell: pwsh
run: |
msbuild $env:SOLUTION_NAME `
/t:Restore `
/p:Configuration=$env:CONFIGURATION

- name: Initialize CodeQL
id: init_codeql
uses: github/codeql-action/init@v1
with:
queries: security-and-quality

- name: Build application
id: build_app
shell: pwsh
run: |
msbuild $env:PROJECT_PATH `
/p:Platform=$env:PLATFORM `
/p:Configuration=$env:CONFIGURATION `
/p:UapAppxPackageBuildMode=$env:APPX_PACKAGE_BUILD_MODE `
/p:AppxBundle=$env:APPX_BUNDLE `
/p:AppxPackageSigningEnabled=false `
/p:AppxBundlePlatforms="$env:APPX_BUNDLE_PLATFORMS"
env:
PLATFORM: x64
APPX_PACKAGE_BUILD_MODE: StoreUpload
APPX_BUNDLE: Always
APPX_BUNDLE_PLATFORMS: x64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing the task to fail, change this to x86 instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed by adding /p:Platform parameter to msbuild call.
platform is still x64.


- name: Perform CodeQL Analysis
id: analyze_codeql
uses: github/codeql-action/analyze@v1

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
58 changes: 58 additions & 0 deletions .github/workflows/csa-bulk-dismissal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Code scanning alerts bulk dismissal

on: [workflow_dispatch]

jobs:
dismiss-alerts:
name: Dismiss alerts
runs-on: ubuntu-latest
strategy:
matrix:
ALERT_DESC: ['"Calls to unmanaged code"', '"Unmanaged code"']
env:
# Settings
OWNER: ${{ github.repository_owner }} # verbatim from URL
PROJECT_NAME: ${{ github.event.repository.name }} # verbatim from URL
ACCESS_TOKEN: ${{ secrets.CSA_ACCESS_TOKEN }} # requires security_events read/write permissions
DISMISS_REASON: ${{ secrets.DISMISS_REASON_VAR }} # "false positive", "won't fix" or "used in tests".
ALERTS_PER_PAGE: 100
ALERT_DESCRIPTION: ${{ matrix.ALERT_DESC }}
steps:
- name: Install jq
id: install_jq
uses: r26d/jq-action@master
with:
cmd: jq -n env

- name: Run automation
id: run_automation
shell: bash
run: |
page=1
LIST_OF_ALERTS=$(curl -u $OWNER:$ACCESS_TOKEN -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/$OWNER/$PROJECT_NAME/code-scanning/alerts?state=open&page=$page&per_page=$ALERTS_PER_PAGE"| jq .[].number )

while [ -n "$LIST_OF_ALERTS" ]
do
echo -n $LIST_OF_ALERTS" " >> "data.json"

((page=page+1))

LIST_OF_ALERTS=$(curl -u $OWNER:$ACCESS_TOKEN -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/$OWNER/$PROJECT_NAME/code-scanning/alerts?state=open&page=$page&per_page=$ALERTS_PER_PAGE"| jq .[].number )
done

LIST_OF_INDEXES=$(cat data.json)

for index in $LIST_OF_INDEXES
do
ALERT_DESC=$(curl -u $OWNER:$ACCESS_TOKEN -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/$OWNER/$PROJECT_NAME/code-scanning/alerts/$index" | jq .rule.description)

if [ "$ALERT_DESC" == "$ALERT_DESCRIPTION" ]; then
ALERT_URL="https://api.github.com/repos/$OWNER/$PROJECT_NAME/code-scanning/alerts/$index"

curl -u $OWNER:$ACCESS_TOKEN -X PATCH -H "Accept: application/vnd.github.v3+json" $ALERT_URL -d '{"state":"dismissed","dismissed_reason":"'"$DISMISS_REASON"'"}'
fi
done

rm -f data.json

# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
Loading