Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IDP-942] Initial commit #1

Merged
merged 11 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"gitversion.tool": {
asimmon marked this conversation as resolved.
Show resolved Hide resolved
"version": "5.12.0",
"commands": [
"dotnet-gitversion"
]
}
}
}
45 changes: 45 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
root = true

# Default settings
[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
indent_size = 2
ij_xml_space_inside_empty_tag = true

# Xml files
[*.{xml,stylecop,resx,ruleset}]
indent_size = 2
ij_xml_space_inside_empty_tag = true

# Xml config files
[*.{props,targets,config,nuspec,conf}]
indent_size = 2
ij_xml_space_inside_empty_tag = true

# YAML config files
[*.{yml,yaml}]
indent_size = 2

# Shell scripts
[*.{sh,ps1}]
end_of_line = lf
indent_size = 2

[*.{cmd,bat}]
end_of_line = crlf
indent_size = 2

# JSON
[*.{json,json5,jsonc}]
indent_size = 2

# CSharp
[*.cs]
max_line_length = off
67 changes: 67 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copied from the .NET runtime repository
# https://github.com/dotnet/runtime/blob/v8.0.0/.gitattributes

# Set default behavior to automatically normalize line endings.
* text=auto

*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

*.jpg binary
*.png binary
*.gif binary

*.lss text

# Force bash scripts to always use lf line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
*.in text eol=lf
*.sh text eol=lf

# Likewise, force cmd and batch scripts to always use crlf
*.cmd text eol=crlf
*.bat text eol=crlf

*.cs text=auto diff=csharp
*.vb text=auto
*.resx text=auto
*.c text=auto
*.cpp text=auto
*.cxx text=auto
*.h text=auto
*.hxx text=auto
*.py text=auto
*.rb text=auto
*.java text=auto
*.html text=auto
*.htm text=auto
*.css text=auto
*.scss text=auto
*.sass text=auto
*.less text=auto
*.js text=auto
*.lisp text=auto
*.clj text=auto
*.sql text=auto
*.php text=auto
*.lua text=auto
*.m text=auto
*.asm text=auto
*.erl text=auto
*.fs text=auto
*.fsx text=auto
*.hs text=auto

*.csproj text=auto
*.vbproj text=auto
*.fsproj text=auto
*.dbproj text=auto
*.sln text=auto eol=crlf
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @gsoft-inc/internal-developer-platform
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

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

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- OS: [e.g. Windows]
- Version: [e.g. 1.2.3]
- IDE: [e.g. Rider]
- etc.

**Additional context**
Add any other context about the problem here.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Please fill out any relevant sections and remove those that don't apply -->

## Description of changes
<!-- What was changed in this pull request? -->

## Breaking changes
<!-- What breaking changes were added (if any) and how are they addressed? -->

## Additional checks
<!-- Please check what applies. Note that some of these are not hard requirements but merely serve as information for reviewers. -->

- [ ] Updated the documentation of the project to reflect the changes
- [ ] Added new tests that cover the code changes
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
pull_request:
branches: [main]
paths-ignore: ["*.md"]

jobs:
main:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-dotnet@v4
with:
source-url: ${{ secrets.NUGET_GSOFTDEV_FEED_URL }}
asimmon marked this conversation as resolved.
Show resolved Hide resolved
env:
NUGET_AUTH_TOKEN: ${{ secrets.GSOFT_NUGET_API_KEY }}

- run: ./Build.ps1
shell: pwsh
env:
NUGET_SOURCE: ${{ secrets.NUGET_GSOFTDEV_FEED_URL }}
NUGET_API_KEY: ${{ secrets.GSOFT_NUGET_API_KEY }}
34 changes: 34 additions & 0 deletions .github/workflows/jira.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Jira

on:
pull_request:
branches: [main]
paths-ignore: ["*.md"]

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Check Jira Story
shell: pwsh
run: |
Install-Module JiraPS -Scope CurrentUser -Force
if ("$env:GITHUB_HEAD_REF" -like "*renovate/*" -eq $True)
{
Write-Host "Skipping, renovate branch detected"
return
}

Set-JiraConfigServer -Server "${{ secrets.JIRA_URL }}"
if("$env:GITHUB_HEAD_REF" -match "IDP-[0-9]+" -eq $False)
asimmon marked this conversation as resolved.
Show resolved Hide resolved
{
throw "Branch name $env:GITHUB_HEAD_REF doesn't respect the required pattern."
}

$JiraIssueKey = $Matches[0]
$PWord = ConvertTo-SecureString -String "${{ secrets.JIRA_API_TOKEN }}" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "${{ secrets.JIRA_USERNAME }}", $PWord

Write-Host "Retrieving Jira issue with number $JiraIssueKey"
Get-JiraIssue -Key $JiraIssueKey -Credential $Credential -ErrorAction Stop | out-null
Write-Host "Successfully retrieved Jira issue"
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish

on:
push:
branches: [main]
tags: ["*.*.*"]
paths-ignore: ["*.md"]

jobs:
main:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-dotnet@v4

- run: ./Build.ps1
shell: pwsh
env:
NUGET_SOURCE: ${{ secrets.NUGET_GSOFT_FEED_URL }}
NUGET_API_KEY: ${{ secrets.WORKLEAP_NUGET_API_KEY }}
50 changes: 50 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Semgrep scan

on:
pull_request:
branches: ["main", "master"]
workflow_dispatch: {}
schedule:
- cron: "52 2 * * 6"

jobs:
semgrep:
runs-on: ubuntu-latest
permissions:
security-events: write

container:
image: returntocorp/semgrep

steps:
- name: Checkout all commits and tags
uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request' }}
with:
fetch-depth: 0

- name: Checkout single commit
uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}

- name: Pull request scan
if: ${{ github.event_name == 'pull_request' }}
run: semgrep scan --config=auto --verbose --time --error --baseline-commit ${{ github.event.pull_request.base.sha }}

- name: Full scan
if: ${{ github.event_name != 'pull_request' }}
run: semgrep scan --config=auto --verbose --time --sarif --output report.sarif

- name: Save report as pipeline artifact
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: report.sarif
path: report.sarif

- name: Publish code scanning alerts
if: ${{ github.event_name != 'pull_request' }}
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: report.sarif
category: semgrep
Loading