Skip to content

Commit bdf57d6

Browse files
authored
chore: Move from Azure DevOps Pipelines to GitHub Actions (#228)
* build: Add global.json and remove version.json; create new workflows for dependency review, component detection, and linting * chore: Add package-lock.json * build: Update Directory.Build.props with package metadata and repository information * chore: Update test projects to use .NET 9 .NET 7 is not supported by the most recent .NET SDK version any more. * chore: Remove ExceptionSerializationTests.cs file * fix(build): Update Codecov slug in workflow configuration * style: Maker super-linter happier
1 parent 415d5c0 commit bdf57d6

21 files changed

+7170
-215
lines changed
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS]
29+
- Browser [e.g. chrome, safari]
30+
- Version [e.g. 22]
3031

3132
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
33+
34+
- Device: [e.g. iPhone6]
35+
- OS: [e.g. iOS8.1]
36+
- Browser [e.g. stock browser, safari]
37+
- Version [e.g. 22]
3638

3739
**Additional context**
3840
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/workflows/codeql.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "CodeQL"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- next
9+
- beta
10+
- dev
11+
- "*.x"
12+
pull_request:
13+
# The branches below must be a subset of the branches above
14+
branches:
15+
- main
16+
- next
17+
- beta
18+
- dev
19+
- "*.x"
20+
schedule:
21+
- cron: "42 2 * * 5"
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ["csharp"]
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v3
46+
with:
47+
languages: ${{ matrix.language }}
48+
49+
- name: Autobuild
50+
uses: github/codeql-action/autobuild@v3
51+
52+
- name: Perform CodeQL Analysis
53+
uses: github/codeql-action/analyze@v3
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Component Detection
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
permissions:
8+
id-token: write
9+
contents: write
10+
11+
jobs:
12+
dependency-submission:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Component detection
17+
uses: advanced-security/component-detection-dependency-submission-action@v0.0.4
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Dependency Review"
2+
on: [pull_request]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
dependency-review:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: "Checkout Repository"
12+
uses: actions/checkout@v4
13+
- name: "Dependency Review"
14+
uses: actions/dependency-review-action@v4.5.0

.github/workflows/dotnet.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: .NET
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- next
8+
- beta
9+
- dev
10+
- "*.x"
11+
pull_request:
12+
branches:
13+
- main
14+
- next
15+
- beta
16+
- dev
17+
- "*.x"
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
global-json-file: global.json
29+
- name: Restore dependencies
30+
run: dotnet restore --locked-mode
31+
- name: Build
32+
run: dotnet build --no-restore
33+
- name: Test
34+
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage"
35+
- name: Upload coverage reports to Codecov
36+
uses: codecov/codecov-action@v5.1.2
37+
with:
38+
token: ${{ secrets.CODECOV_TOKEN }}
39+
slug: hangy/AntiXss/hangy/AntiXss
40+
- name: Upload test results to Codecov
41+
if: ${{ !cancelled() }}
42+
uses: codecov/test-results-action@v1
43+
with:
44+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/linter.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
#################################
3+
#################################
4+
## Super Linter GitHub Actions ##
5+
#################################
6+
#################################
7+
name: Lint Code Base
8+
9+
#
10+
# Documentation:
11+
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
12+
#
13+
14+
#############################
15+
# Start the job on all push #
16+
#############################
17+
on:
18+
# push:
19+
# branches-ignore: [main]
20+
# Remove the line above to run when pushing to master
21+
pull_request:
22+
branches: [main]
23+
24+
###############
25+
# Set the Job #
26+
###############
27+
jobs:
28+
build:
29+
# Name the Job
30+
name: Lint Code Base
31+
# Set the agent to run on
32+
runs-on: ubuntu-latest
33+
34+
############################################
35+
# Grant status permission for MULTI_STATUS #
36+
############################################
37+
permissions:
38+
contents: read
39+
packages: read
40+
statuses: write
41+
42+
##################
43+
# Load all steps #
44+
##################
45+
steps:
46+
##########################
47+
# Checkout the code base #
48+
##########################
49+
- name: Checkout Code
50+
uses: actions/checkout@v4
51+
with:
52+
# Full git history is needed to get a proper
53+
# list of changed files within `super-linter`
54+
fetch-depth: 0
55+
56+
################################
57+
# Run Linter against code base #
58+
################################
59+
- name: Lint Code Base
60+
uses: super-linter/super-linter@v7
61+
env:
62+
VALIDATE_ALL_CODEBASE: false
63+
DEFAULT_BRANCH: main
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- next
7+
- beta
8+
- "*.x"
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read # for checkout
13+
14+
jobs:
15+
release:
16+
name: Release
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write # to be able to publish a GitHub release
20+
issues: write # to be able to comment on released issues
21+
pull-requests: write # to be able to comment on released pull requests
22+
id-token: write # to enable use of OIDC for npm provenance
23+
packages: write # to be able to publish to GitHub Packages
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
- name: Setup .NET
30+
uses: actions/setup-dotnet@v4
31+
with:
32+
global-json-file: global.json
33+
- name: Restore dependencies
34+
run: dotnet restore --locked-mode
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: "lts/*"
39+
check-latest: true
40+
- name: Install dependencies
41+
run: npm clean-install
42+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
43+
run: npm audit signatures
44+
- name: Release
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
NUGET_TOKEN: ${{ secrets.NUGET_ORG_API_KEY }}
48+
CI_COMMIT_SHA: ${{ github.sha }}
49+
run: npx semantic-release
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Lint PR"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
pull-requests: read
12+
13+
jobs:
14+
main:
15+
name: Validate PR title
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: amannn/action-semantic-pull-request@v5
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package.json
2+
package-lock.json

0 commit comments

Comments
 (0)