Skip to content

Commit ba514e3

Browse files
authored
Merge pull request #197 from SamErde/update-actions
Maintenance for actions and settings
2 parents d14c532 + 8df0103 commit ba514e3

File tree

4 files changed

+89
-89
lines changed

4 files changed

+89
-89
lines changed

.cspell.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"import": [
3+
"@cspell/dict-powershell/cspell-ext.json",
4+
"@cspell/dict-csharp/cspell-ext.json"
5+
],
6+
7+
"version": "0.2",
8+
"language": "en",
9+
10+
"words": [
11+
"RSAT",
12+
"Artefacts",
13+
"NTDS",
14+
"Hildreth"
15+
],
16+
17+
"ignoreWords": [
18+
"malconfiguration",
19+
"sarif",
20+
"psscriptanalyzer",
21+
"DEVSKIM",
22+
"KICS",
23+
"pscustomobject",
24+
"certutil",
25+
"certsvc",
26+
"setreg",
27+
"contoso",
28+
"SCHANNEL",
29+
"RSATAD",
30+
"Dism",
31+
"getreg",
32+
"Dacl",
33+
"Calver"
34+
],
35+
36+
"flagWords": [
37+
],
38+
39+
"patterns": [
40+
{
41+
"name": "ALL-CAPS-WORDS",
42+
"pattern": "/\b[A-Z0-9]+\b/g",
43+
"description": "Any word in ALL CAPS."
44+
}
45+
],
46+
47+
"ignoreRegExpList": [
48+
"ALL-CAPS-WORDS",
49+
"Email",
50+
"github.com/",
51+
"@"
52+
]
53+
}

.github/workflows/mega-linter.yml

Lines changed: 14 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
---
44
name: MegaLinter
55

6-
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to main
6+
# Trigger mega-linter at every pull request.
77
on:
88
# Comment this line to trigger action only on pull-requests
99
# (not recommended if you don't pay for GH Actions)
1010
# push:
1111

1212
pull_request:
13-
branches:
13+
# branches:
1414
# - main
15-
- testing
15+
# - testing
1616
# - dev
1717
# - experimental
1818

@@ -44,9 +44,9 @@
4444
# Give the default GITHUB_TOKEN write permission to commit and push, comment
4545
# issues & post new PR; remove the ones you do not need
4646
permissions:
47-
contents: write
48-
issues: write
49-
pull-requests: write
47+
contents: read
48+
issues: read
49+
pull-requests: read
5050

5151
steps:
5252

@@ -58,15 +58,15 @@
5858

5959
# If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to
6060
# improve performance
61-
fetch-depth: 0
61+
# fetch-depth: 0
6262

6363
# MegaLinter
6464
- name: MegaLinter
6565

6666
# You can override MegaLinter flavor used to have faster performances
6767
# More info at https://megalinter.io/flavors/
6868
# The dotnet flavor includes PowerShell, MD, YAML, JSON, spelling, and more.
69-
uses: oxsecurity/megalinter/flavors/dotnet@v7.7.0
69+
uses: oxsecurity/megalinter/flavors/dotnet@v8.3.0
7070

7171
id: ml
7272

@@ -78,19 +78,19 @@
7878
# main. Override with true if you always want to lint all sources
7979
#
8080
# To validate the entire codebase, set to:
81-
# VALIDATE_ALL_CODEBASE: true
81+
VALIDATE_ALL_CODEBASE: true
8282
#
8383
# To validate only diff with main, set to:
8484
# VALIDATE_ALL_CODEBASE: >-
8585
# ${{
8686
# github.event_name == 'push' &&
8787
# contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref)
8888
# }}
89-
VALIDATE_ALL_CODEBASE: >-
90-
${{
91-
github.event_name == 'push' &&
92-
contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref)
93-
}}
89+
# VALIDATE_ALL_CODEBASE: >-
90+
# ${{
91+
# github.event_name == 'push' &&
92+
# contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref)
93+
# }}
9494

9595
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9696

@@ -113,69 +113,3 @@
113113
path: |
114114
megalinter-reports
115115
mega-linter.log
116-
117-
# Set APPLY_FIXES_IF var for use in future steps
118-
- name: Set APPLY_FIXES_IF var
119-
run: |
120-
printf 'APPLY_FIXES_IF=%s\n' "${{
121-
steps.ml.outputs.has_updated_sources == 1 &&
122-
(
123-
env.APPLY_FIXES_EVENT == 'all' ||
124-
env.APPLY_FIXES_EVENT == github.event_name
125-
) &&
126-
(
127-
github.event_name == 'push' ||
128-
github.event.pull_request.head.repo.full_name == github.repository
129-
)
130-
}}" >> "${GITHUB_ENV}"
131-
132-
# Set APPLY_FIXES_IF_* vars for use in future steps
133-
- name: Set APPLY_FIXES_IF_* vars
134-
run: |
135-
printf 'APPLY_FIXES_IF_PR=%s\n' "${{
136-
env.APPLY_FIXES_IF == 'true' &&
137-
env.APPLY_FIXES_MODE == 'pull_request'
138-
}}" >> "${GITHUB_ENV}"
139-
printf 'APPLY_FIXES_IF_COMMIT=%s\n' "${{
140-
env.APPLY_FIXES_IF == 'true' &&
141-
env.APPLY_FIXES_MODE == 'commit' &&
142-
(!contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref))
143-
}}" >> "${GITHUB_ENV}"
144-
145-
# Create pull request if applicable
146-
# (for now works only on PR from same repository, not from forks)
147-
- name: Create Pull Request with applied fixes
148-
uses: peter-evans/create-pull-request@v5
149-
id: cpr
150-
if: env.APPLY_FIXES_IF_PR == 'true'
151-
with:
152-
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
153-
commit-message: "[MegaLinter] Apply linters automatic fixes"
154-
title: "[MegaLinter] Apply linters automatic fixes"
155-
labels: bot
156-
157-
- name: Create PR output
158-
if: env.APPLY_FIXES_IF_PR == 'true'
159-
run: |
160-
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
161-
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
162-
163-
# Push new commit if applicable
164-
# (for now works only on PR from same repository, not from forks)
165-
- name: Prepare commit
166-
if: env.APPLY_FIXES_IF_COMMIT == 'true'
167-
run: sudo chown -Rc $UID .git/
168-
169-
- name: Commit and push applied linter fixes
170-
uses: stefanzweifel/git-auto-commit-action@v5
171-
if: env.APPLY_FIXES_IF_COMMIT == 'true'
172-
with:
173-
branch: >-
174-
${{
175-
github.event.pull_request.head.ref ||
176-
github.head_ref ||
177-
github.ref
178-
}}
179-
commit_message: "[MegaLinter] Apply linters fixes"
180-
commit_user_name: megalinter-bot
181-
commit_user_email: megalinter@dotdot.horse

.github/workflows/powershell.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313
push:
1414
branches: [ "testing" ]
1515
pull_request:
16-
branches: [ "testing" ]
1716
schedule:
1817
- cron: '41 14 * * 4'
1918

@@ -29,7 +28,7 @@ jobs:
2928
name: PSScriptAnalyzer
3029
runs-on: ubuntu-latest
3130
steps:
32-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
3332

3433
- name: Run PSScriptAnalyzer
3534
uses: microsoft/psscriptanalyzer-action@6b2948b1944407914a58661c49941824d149734f
@@ -44,6 +43,6 @@ jobs:
4443

4544
# Upload the SARIF file generated in the previous step
4645
- name: Upload SARIF results file
47-
uses: github/codeql-action/upload-sarif@v2
46+
uses: github/codeql-action/upload-sarif@v3
4847
with:
4948
sarif_file: results.sarif

.gitignore

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
.DS_Store
2-
.vs/*
3-
.vscode/*
4-
ADCSIssues.CSV
5-
ADCSRemediation.CSV
61
Artefacts/*
72
Examples/Output/*
83
Ignore/*
9-
Invoke-RevertLocksmith.ps1
104
Lib/Core/*
115
Lib/Default/*
126
Lib/Standard/*
@@ -19,3 +13,23 @@ Sources/*/bin
1913
Sources/*/*/obj
2014
Sources/*/*/bin
2115
Sources/packages/*
16+
17+
### Visual Studio / Code ###
18+
.vs/*
19+
.vscode/*
20+
!.vscode/settings.json
21+
!.vscode/tasks.json
22+
!.vscode/launch.json
23+
!.vscode/extensions.json
24+
!.vscode/*.code-snippets
25+
26+
### Module Output Files ###
27+
ADCSIssues.CSV
28+
ADCSRemediation.CSV
29+
Locksmith*ADCSIssues.CSV
30+
Locksmith*ADCSRemediation.CSV
31+
Invoke-RevertLocksmith.ps1
32+
33+
### OS Files ###
34+
.DS_Store
35+
Thumbs.db

0 commit comments

Comments
 (0)