-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created the .NET Library CodeQL composite Action
- Loading branch information
1 parent
68baf41
commit 1b11e68
Showing
4 changed files
with
129 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "07:00" | ||
timezone: "Pacific/Auckland" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Action Name | ||
name: Automated Releases | ||
|
||
# Controls when the action will run | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
# Workflow Jobs | ||
jobs: | ||
# Build Job | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Step 1 - Checkout Code | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2 - Extract Environment Variables | ||
- name: Extract Environment Variables | ||
uses: FranzDiebold/github-env-vars-action@v2 | ||
|
||
# Step 3 - Generate the Changelog | ||
- name: Generate the Changelog | ||
id: changelog | ||
if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
uses: metcalfc/changelog-generator@v4.0.1 | ||
with: | ||
myToken: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Step 4 - Create GitHub Release | ||
- name: Create GitHub Release | ||
if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.CI_REF_NAME }} | ||
name: Release ${{ env.CI_REF_NAME }} | ||
body: | | ||
${{ steps.changelog.outputs.changelog }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
# dotnet-library-codeql-action | ||
# .NET Library CodeQL Action | ||
A Composite Action that runs CodeQL to Analyze a .NET 6/7 Library | ||
|
||
## Inputs | ||
|
||
### `private-nuget-url` | ||
|
||
**Required** The URL of the Private NuGet Repository (e.g. https://nuget.pkg.github.com/myname/index.json) | ||
|
||
### `private-nuget-token` | ||
|
||
**Required** The Token used for Authentication with the Private NuGet Repository | ||
|
||
## Example Usage | ||
|
||
```yml | ||
uses: ricado-group/dotnet-library-codeql-action@v1 | ||
with: | ||
private-nuget-url: 'https://nuget.pkg.github.com/myname/index.json' | ||
private-nuget-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
``` | ||
## Stay Updated with Dependabot | ||
Use [Dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot) to update your GitHub Actions by creating a `.github/dependabot.yml` file: | ||
|
||
```yaml | ||
version: 2 | ||
updates: | ||
# Maintain Dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: '.NET Library CodeQL' | ||
description: 'A Composite Action that runs CodeQL to Analyze a .NET 6/7 Library' | ||
author: 'RICADO Group' | ||
branding: | ||
icon: 'link' | ||
color: 'blue' | ||
|
||
# Inputs | ||
inputs: | ||
private-nuget-url: | ||
description: 'The URL of the Private NuGet Repository (e.g. https://nuget.pkg.github.com/myname/index.json)' | ||
required: true | ||
private-nuget-token: | ||
description: 'The Token used for Authentication with the Private NuGet Repository' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
# Step 1 - Initialize CodeQL | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: csharp | ||
queries: security-and-quality | ||
|
||
# Step 2 - Setup .NET 6 & 7 with GitHub Packages Authentication | ||
- name: Setup .NET 6 with GitHub Packages Authentication | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: | | ||
6.0.x | ||
7.0.x | ||
source-url: ${{ inputs.private-nuget-url }} | ||
env: | ||
NUGET_AUTH_TOKEN: ${{ inputs.private-nuget-token }} | ||
|
||
# Step 3 - Build the Library | ||
- name: Run CodeQL Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
# Step 4 - Perform CodeQL Analysis | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |