Skip to content

Commit fb897d7

Browse files
authored
Initial commit
0 parents  commit fb897d7

27 files changed

+1549
-0
lines changed

.cspell.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "0.2",
3+
"language": "en",
4+
"ignorePaths": [
5+
"**/node_modules/**",
6+
"**/vscode-extension/**",
7+
"**/.git/**",
8+
"**/.pnpm-lock.json",
9+
".vscode",
10+
"package-lock.json",
11+
"megalinter-reports"
12+
],
13+
"words": [
14+
"nupkg",
15+
"msbuild",
16+
"megalinter",
17+
"markdownlint",
18+
"KICS",
19+
"Carrol",
20+
"ncipollo",
21+
"stefanzweifel",
22+
"ruleset"
23+
]
24+
}

.github/DISABLE_dependabot.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: "/"
6+
commit-message:
7+
prefix: "(dependabot)"
8+
assignees:
9+
- "TylerCarrol"
10+
reviewers:
11+
- "TylerCarrol"
12+
schedule:
13+
interval: monthly
14+
15+
- package-ecosystem: nuget
16+
directory: "/"
17+
commit-message:
18+
prefix: "(dependabot)"
19+
assignees:
20+
- "TylerCarrol"
21+
reviewers:
22+
- "TylerCarrol"
23+
schedule:
24+
interval: monthly
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Error Annotation
2+
description: Error Annotation
3+
4+
inputs:
5+
message:
6+
description: "Message to Display"
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- uses: actions/github-script@v7.0.1
13+
with:
14+
script: |
15+
var message = '${{ inputs.message }}';
16+
message = message.replace(/(\r\n|\n|\r)/gm, '');
17+
core.error(message);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Notice Annotation
2+
description: Notice Annotation
3+
4+
inputs:
5+
message:
6+
description: "Message to Display"
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- uses: actions/github-script@v7.0.1
13+
with:
14+
script: |
15+
var message = '${{ inputs.message }}';
16+
message = message.replace(/(\r\n|\n|\r)/gm, '');
17+
core.notice(message);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Warning Annotation
2+
description: Warning Annotation
3+
4+
inputs:
5+
message:
6+
description: "Message to Display"
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- uses: actions/github-script@v7.0.1
13+
with:
14+
script: |
15+
var message = '${{ inputs.message }}';
16+
message = message.replace(/(\r\n|\n|\r)/gm, '');
17+
core.warning(message);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Exit Code
2+
description: Exit Code
3+
4+
inputs:
5+
code:
6+
description: "Exit Code Number (ensure it is unique across all workflows/actions)"
7+
required: true
8+
message:
9+
description: "Exit Message"
10+
required: false
11+
default: ""
12+
level:
13+
description: "Annotation Level (Error, Warning, Debug, Notice)"
14+
default: error
15+
16+
runs:
17+
using: "composite"
18+
steps:
19+
- id: createMessage
20+
uses: actions/github-script@v7.0.1
21+
with:
22+
result-encoding: string
23+
script: >
24+
return '[Exit Code: ${{ inputs.code }}] ${{ inputs.message }} | Note: Search for "code: ${{ inputs.code }}" in the .github/ directory to find the source of this error'
25+
26+
- uses: ./.github/actions/tools/annotation/error
27+
if: inputs.level == 'error'
28+
with:
29+
message: ${{ steps.createMessage.outputs.result }}
30+
31+
- uses: ./.github/actions/tools/annotation/warning
32+
if: inputs.level == 'warning'
33+
with:
34+
message: ${{ steps.createMessage.outputs.result }}
35+
36+
- uses: ./.github/actions/tools/annotation/debug
37+
if: inputs.level == 'debug'
38+
with:
39+
message: ${{ steps.createMessage.outputs.result }}
40+
41+
- uses: ./.github/actions/tools/annotation/notice
42+
if: inputs.level == 'notice'
43+
with:
44+
message: ${{ steps.createMessage.outputs.result }}
45+
46+
- shell: cmd
47+
if: ${{ runner.os == 'Windows' }}
48+
run: exit ${{ inputs.code }}
49+
50+
- shell: bash
51+
if: ${{ runner.os != 'Windows' }}
52+
run: exit ${{ inputs.code }}

.github/ruleset-collection.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"id": 2317352,
3+
"name": "TJC NuGet Collection Ruleset",
4+
"target": "branch",
5+
"source_type": "Repository",
6+
"source": "TJC-Tools/TJC.Collection.Core",
7+
"enforcement": "active",
8+
"conditions": {
9+
"ref_name": {
10+
"exclude": [],
11+
"include": ["~DEFAULT_BRANCH"]
12+
}
13+
},
14+
"rules": [
15+
{
16+
"type": "deletion"
17+
},
18+
{
19+
"type": "non_fast_forward"
20+
},
21+
{
22+
"type": "pull_request",
23+
"parameters": {
24+
"required_approving_review_count": 1,
25+
"dismiss_stale_reviews_on_push": true,
26+
"require_code_owner_review": true,
27+
"require_last_push_approval": true,
28+
"required_review_thread_resolution": false
29+
}
30+
},
31+
{
32+
"type": "required_linear_history"
33+
},
34+
{
35+
"type": "required_status_checks",
36+
"parameters": {
37+
"strict_required_status_checks_policy": true,
38+
"do_not_enforce_on_create": false,
39+
"required_status_checks": [
40+
{
41+
"context": "Continuous Testing (Testing.sln, 8.0.x)",
42+
"integration_id": 15368
43+
},
44+
{
45+
"context": "MegaLinter",
46+
"integration_id": 15368
47+
}
48+
]
49+
}
50+
}
51+
],
52+
"bypass_actors": [
53+
{
54+
"actor_id": 1,
55+
"actor_type": "OrganizationAdmin",
56+
"bypass_mode": "always"
57+
}
58+
]
59+
}

.github/ruleset.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"id": 2317340,
3+
"name": "TJC NuGet Package Ruleset",
4+
"target": "branch",
5+
"source_type": "Repository",
6+
"source": "TJC-Templates/Template.NuGet.Package",
7+
"enforcement": "active",
8+
"conditions": {
9+
"ref_name": {
10+
"exclude": [],
11+
"include": ["~DEFAULT_BRANCH"]
12+
}
13+
},
14+
"rules": [
15+
{
16+
"type": "deletion"
17+
},
18+
{
19+
"type": "non_fast_forward"
20+
},
21+
{
22+
"type": "pull_request",
23+
"parameters": {
24+
"required_approving_review_count": 1,
25+
"dismiss_stale_reviews_on_push": true,
26+
"require_code_owner_review": true,
27+
"require_last_push_approval": true,
28+
"required_review_thread_resolution": false
29+
}
30+
},
31+
{
32+
"type": "required_linear_history"
33+
},
34+
{
35+
"type": "required_status_checks",
36+
"parameters": {
37+
"strict_required_status_checks_policy": true,
38+
"do_not_enforce_on_create": false,
39+
"required_status_checks": [
40+
{
41+
"context": "Continuous Testing (Testing.sln, 8.0.x)",
42+
"integration_id": 15368
43+
},
44+
{
45+
"context": "CodeQL",
46+
"integration_id": 57789
47+
},
48+
{
49+
"context": "Analyze (csharp)",
50+
"integration_id": 15368
51+
},
52+
{
53+
"context": "MegaLinter",
54+
"integration_id": 15368
55+
},
56+
{
57+
"context": "Changelog Changed",
58+
"integration_id": 15368
59+
}
60+
]
61+
}
62+
}
63+
],
64+
"bypass_actors": [
65+
{
66+
"actor_id": 1,
67+
"actor_type": "OrganizationAdmin",
68+
"bypass_mode": "always"
69+
}
70+
]
71+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# This workflow ensures that a change was made to the changelog
2+
---
3+
name: Changelog Changed
4+
run-name: >-
5+
${{
6+
format(
7+
'{0} - Changelog Changed{1}',
8+
github.event_name == 'pull_request'
9+
&& format('PR#{0}{1}',github.event.number, github.event.pull_request.draft && ' [DRAFT]' || '')
10+
|| format('Push [{0}]', github.ref_name),
11+
github.event_name == 'pull_request'
12+
&& format(' - [{0}-to-{1}]', github.event.pull_request.head.ref, github.event.pull_request.base.ref)
13+
|| ''
14+
)
15+
}}
16+
on:
17+
pull_request:
18+
branches:
19+
- main
20+
- develop
21+
types:
22+
- opened
23+
- reopened
24+
- synchronize
25+
- ready_for_review
26+
# Trigger if target branch was changed to a trunk
27+
pull_request_target:
28+
types:
29+
- edited
30+
branches:
31+
- main
32+
- develop
33+
34+
concurrency:
35+
group: Changelog-${{ github.event.pull_request.head.ref }}-to-${{ github.event.pull_request.base.ref }}
36+
cancel-in-progress: true
37+
38+
jobs:
39+
checkForChangesToChangelog:
40+
name: Changelog Changed
41+
permissions:
42+
contents: read # Read access to code and content in the repository
43+
pull-requests: read # Read access to pull request metadata for the event
44+
checks: write # Write access to report check results
45+
runs-on: ubuntu-latest
46+
if: ${{ !github.event.pull_request.draft }}
47+
48+
steps:
49+
# Checkout pull request branch
50+
- name: ${{ format('Checkout [{0}]', github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name) }}
51+
uses: actions/checkout@v4
52+
with:
53+
ref: ${{ github.event.pull_request.head.ref }}
54+
token: ${{ secrets.TJC_TOKEN || secrets.GITHUB_TOKEN }}
55+
56+
# Check for Changes in Changelog
57+
- name: Check for Changes to Changelog
58+
id: getChanges
59+
uses: tj-actions/changed-files@v45.0.8
60+
with:
61+
files: CHANGELOG.md
62+
63+
# Report Success
64+
- name: Success - Changelog Changed
65+
if: steps.getChanges.outputs.any_modified == 'true'
66+
uses: ./.github/actions/tools/annotation/notice
67+
with:
68+
message: "[Success] Changelog Changed"
69+
70+
# Report Failure
71+
- name: Failure - Changelog Not Changed
72+
if: steps.getChanges.outputs.any_modified != 'true'
73+
uses: ./.github/actions/tools/exit-code
74+
with:
75+
code: 5
76+
message: "Changelog Not Changed"

0 commit comments

Comments
 (0)