Skip to content

Commit 3b01a73

Browse files
authored
Merge pull request #33 from aleks-ivanov/feature/windows-store
Feature/windows store
2 parents 037e739 + 679aa15 commit 3b01a73

40 files changed

+1086
-10
lines changed

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
# default location of `.github/workflows`
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
9+
- package-ecosystem: "nuget"
10+
# location of package manifests
11+
directory: "/src/Notepads"
12+
schedule:
13+
interval: "daily"
14+
15+
- package-ecosystem: "nuget"
16+
# location of package manifests
17+
directory: "/src/Notepads.Controls"
18+
schedule:
19+
interval: "daily"
20+
21+
# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CodeQL Analysis
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 8 * * *'
8+
9+
jobs:
10+
analyze:
11+
name: codeql-analysis
12+
runs-on: windows-latest
13+
strategy:
14+
matrix:
15+
configuration: [ Production ]
16+
env:
17+
SOLUTION_NAME: src\Notepads.sln
18+
PROJECT_PATH: src\Notepads\Notepads.csproj
19+
CONFIGURATION: ${{ matrix.configuration }}
20+
steps:
21+
- name: Checkout repository
22+
id: checkout_repo
23+
uses: actions/checkout@v2
24+
25+
# Due to the insufficient memory allocated by default, CodeQL sometimes requires more to be manually allocated
26+
- name: Configure Pagefile
27+
id: config_pagefile
28+
uses: al-cheb/configure-pagefile-action@v1.2
29+
with:
30+
minimum-size: 8GB
31+
maximum-size: 32GB
32+
disk-root: "D:"
33+
34+
- name: Setup MSBuild
35+
id: setup_msbuild
36+
uses: microsoft/setup-msbuild@v1
37+
38+
- name: Restore application
39+
id: restore_app
40+
shell: pwsh
41+
run: |
42+
msbuild $env:SOLUTION_NAME `
43+
/t:Restore `
44+
/p:Configuration=$env:CONFIGURATION
45+
46+
- name: Initialize CodeQL
47+
id: init_codeql
48+
uses: github/codeql-action/init@v1
49+
with:
50+
queries: security-and-quality
51+
52+
- name: Build application
53+
id: build_app
54+
shell: pwsh
55+
run: |
56+
msbuild $env:PROJECT_PATH `
57+
/p:Platform=$env:PLATFORM `
58+
/p:Configuration=$env:CONFIGURATION `
59+
/p:UapAppxPackageBuildMode=$env:APPX_PACKAGE_BUILD_MODE `
60+
/p:AppxBundle=$env:APPX_BUNDLE `
61+
/p:AppxPackageSigningEnabled=false `
62+
/p:AppxBundlePlatforms="$env:APPX_BUNDLE_PLATFORMS"
63+
env:
64+
PLATFORM: x64
65+
APPX_PACKAGE_BUILD_MODE: StoreUpload
66+
APPX_BUNDLE: Always
67+
APPX_BUNDLE_PLATFORMS: x64
68+
69+
- name: Perform CodeQL Analysis
70+
id: analyze_codeql
71+
uses: github/codeql-action/analyze@v1
72+
73+
# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Code scanning alerts bulk dismissal
2+
3+
on: [workflow_dispatch]
4+
5+
jobs:
6+
dismiss-alerts:
7+
name: Dismiss alerts
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
ALERT_DESC: ['"Calls to unmanaged code"', '"Unmanaged code"']
12+
env:
13+
# Settings
14+
OWNER: ${{ github.repository_owner }} # verbatim from URL
15+
PROJECT_NAME: ${{ github.event.repository.name }} # verbatim from URL
16+
ACCESS_TOKEN: ${{ secrets.CSA_ACCESS_TOKEN }} # requires security_events read/write permissions
17+
DISMISS_REASON: ${{ secrets.DISMISS_REASON_VAR }} # "false positive", "won't fix" or "used in tests".
18+
ALERTS_PER_PAGE: 100
19+
ALERT_DESCRIPTION: ${{ matrix.ALERT_DESC }}
20+
steps:
21+
- name: Install jq
22+
id: install_jq
23+
uses: r26d/jq-action@master
24+
with:
25+
cmd: jq -n env
26+
27+
- name: Run automation
28+
id: run_automation
29+
shell: bash
30+
run: |
31+
page=1
32+
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 )
33+
34+
while [ -n "$LIST_OF_ALERTS" ]
35+
do
36+
echo -n $LIST_OF_ALERTS" " >> "data.json"
37+
38+
((page=page+1))
39+
40+
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 )
41+
done
42+
43+
LIST_OF_INDEXES=$(cat data.json)
44+
45+
for index in $LIST_OF_INDEXES
46+
do
47+
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)
48+
49+
if [ "$ALERT_DESC" == "$ALERT_DESCRIPTION" ]; then
50+
ALERT_URL="https://api.github.com/repos/$OWNER/$PROJECT_NAME/code-scanning/alerts/$index"
51+
52+
curl -u $OWNER:$ACCESS_TOKEN -X PATCH -H "Accept: application/vnd.github.v3+json" $ALERT_URL -d '{"state":"dismissed","dismissed_reason":"'"$DISMISS_REASON"'"}'
53+
fi
54+
done
55+
56+
rm -f data.json
57+
58+
# Built with ❤ by [Pipeline Foundation](https://pipeline.foundation)

0 commit comments

Comments
 (0)