Skip to content

Commit a45d9de

Browse files
author
tmarwendo
committed
Add contribution, license, update readme, security notice, code_of_conduct, barebones github actions
1 parent e269af7 commit a45d9de

14 files changed

+472
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
3+
{
4+
"name": "C# (.NET)",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0",
7+
"features": {
8+
"ghcr.io/azure/azure-dev/azd:0": {}
9+
},
10+
11+
// Features to add to the dev container. More info: https://containers.dev/features.
12+
// "features": {},
13+
14+
//Use 'forwardPorts' to make a list of ports inside the container available locally.
15+
"forwardPorts": [5000, 5001],
16+
"portsAttributes": {
17+
"5001": {
18+
"protocol": "https"
19+
}
20+
},
21+
22+
// Use 'postCreateCommand' to run commands after the container is created.
23+
"postCreateCommand": "dotnet restore",
24+
25+
// Configure tool-specific properties.
26+
// "customizations": {},
27+
28+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
29+
"remoteUser": "root"
30+
}

.github/CODE_OF_CONDUCT.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Microsoft Open Source Code of Conduct
2+
3+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4+
5+
Resources:
6+
7+
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8+
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9+
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns

.github/ISSUE_TEMPLATE.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!--
2+
IF SUFFICIENT INFORMATION IS NOT PROVIDED VIA THE FOLLOWING TEMPLATE THE ISSUE MIGHT BE CLOSED WITHOUT FURTHER CONSIDERATION OR INVESTIGATION
3+
-->
4+
> Please provide us with the following information:
5+
> ---------------------------------------------------------------
6+
7+
### This issue is for a: (mark with an `x`)
8+
```
9+
- [ ] bug report -> please search issues before submitting
10+
- [ ] feature request
11+
- [ ] documentation issue or request
12+
- [ ] regression (a behavior that used to work and stopped in a new release)
13+
```
14+
15+
### Minimal steps to reproduce
16+
>
17+
18+
### Any log messages given by the failure
19+
>
20+
21+
### Expected/desired behavior
22+
>
23+
24+
### OS and Version?
25+
> Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
26+
27+
### Versions
28+
>
29+
30+
### Mention any other details that might be useful
31+
32+
> ---------------------------------------------------------------
33+
> Thanks! We'll be in touch soon.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Purpose
2+
<!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? -->
3+
* ...
4+
5+
## Does this introduce a breaking change?
6+
<!-- Mark one with an "x". -->
7+
```
8+
[ ] Yes
9+
[ ] No
10+
```
11+
12+
## Pull Request Type
13+
What kind of change does this Pull Request introduce?
14+
15+
<!-- Please check the one that applies to this PR using "x". -->
16+
```
17+
[ ] Bugfix
18+
[ ] Feature
19+
[ ] Code style update (formatting, local variables)
20+
[ ] Refactoring (no functional changes, no api changes)
21+
[ ] Documentation content changes
22+
[ ] Other... Please describe:
23+
```
24+
25+
## How to Test
26+
* Get the code
27+
28+
```
29+
git clone [repo-address]
30+
cd [repo-name]
31+
git checkout [branch-name]
32+
npm install
33+
```
34+
35+
* Test the code
36+
<!-- Add steps to run the tests suite and/or manually test -->
37+
```
38+
```
39+
40+
## What to Check
41+
Verify that the following are valid
42+
* ...
43+
44+
## Other Information
45+
<!-- Add any other helpful information that may be needed here. -->

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Validate AZD template
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- "infra/**"
8+
pull_request:
9+
branches: [ main ]
10+
paths:
11+
- "infra/**"
12+
13+
permissions:
14+
contents: read
15+
actions: read
16+
security-events: write
17+
18+
jobs:
19+
build:
20+
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Build Bicep for linting
27+
uses: azure/CLI@v1
28+
with:
29+
inlineScript: az config set bicep.use_binary_from_path=false && az bicep build -f infra/main.bicep --stdout
30+
31+
- name: Run Microsoft Security DevOps Analysis
32+
uses: microsoft/security-devops-action@preview
33+
id: msdo
34+
continue-on-error: true
35+
with:
36+
tools: templateanalyzer
37+
38+
- name: Upload alerts to Security tab
39+
uses: github/codeql-action/upload-sarif@v3
40+
if: github.repository == 'Azure-Samples/azure-search-openai-demo-csharp'
41+
with:
42+
sarif_file: ${{ steps.msdo.outputs.sarifFile }}

.github/workflows/azure-dev.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Main Deployment
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
reason:
6+
description: The reason for running the workflow
7+
required: false
8+
default: Manual run
9+
push:
10+
branches:
11+
- main
12+
13+
# https://learn.microsoft.com/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux#set-up-azure-login-with-openid-connect-authentication
14+
permissions:
15+
id-token: write
16+
contents: read
17+
18+
env:
19+
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
20+
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
21+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
22+
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
23+
AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
24+
AZURE_DEV_USER_AGENT: ${{ secrets.AZURE_DEV_USER_AGENT }}
25+
# Existing resources, when applicable
26+
AZURE_CONTAINER_REGISTRY_ENDPOINT: ${{ vars.AZURE_CONTAINER_REGISTRY_ENDPOINT }}
27+
AZURE_AI_SERVICE_APP_KEY: ${{ vars.AZURE_AI_SERVICE_APP_KEY }}
28+
AZURE_KEY_VAULT_NAME: ${{ vars.AZURE_KEY_VAULT_NAME }}
29+
AZURE_KEY_VAULT_RESOURCE_GROUP: ${{ vars.AZURE_KEY_VAULT_RESOURCE_GROUP }}
30+
31+
jobs:
32+
build:
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout
37+
38+
- name: Checkout
39+
uses: actions/checkout@v3
40+
41+
- name: Install azd
42+
uses: Azure/setup-azd@v2
43+
44+
- name: 'Print manual run reason'
45+
if: ${{ github.event_name == 'workflow_dispatch' }}
46+
run: |
47+
echo 'Reason: ${{ github.event.inputs.reason }}'
48+
49+
- name: Setup .NET
50+
uses: actions/setup-dotnet@v3
51+
with:
52+
dotnet-version: 8.0.x
53+
54+
# devnote: TODO
55+
# - name: Log in with Azure
56+
57+
# devnote: TODO
58+
# - name: Provision Infrastructure
59+
60+
# devnote TODO
61+
# - name: Deploy Application

.github/workflows/dotnet-build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build & Test .NET Deployment
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v3
18+
with:
19+
dotnet-version: 8.0.x
20+
- name: Restore dependencies
21+
run: dotnet restore ./app/app.sln
22+
- name: Build
23+
run: dotnet build ./app/app.sln -c Release
24+
- name: Test
25+
run: dotnet test ./app/app.sln --verbosity normal -c Release
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Profanity filter
2+
3+
on:
4+
issue_comment:
5+
types: [created, edited]
6+
issues:
7+
types: [opened, edited, reopened]
8+
pull_request:
9+
types: [opened, edited, reopened]
10+
11+
jobs:
12+
apply-filter:
13+
name: Apply profanity filter
14+
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
pull-requests: write
18+
19+
steps:
20+
- name: Profanity filter
21+
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'github-actions[bot]' }}
22+
uses: IEvangelist/profanity-filter@main
23+
id: profanity-filter
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
replacement-strategy: asterisk

.github/workflows/stale-bot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Close stale issues and PRs'
2+
on:
3+
schedule:
4+
- cron: '30 1 * * *'
5+
6+
jobs:
7+
stale:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/stale@v9
11+
with:
12+
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.'
13+
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed.'
14+
close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
15+
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
16+
days-before-issue-stale: 60
17+
days-before-pr-stale: 60
18+
days-before-issue-close: -1
19+
days-before-pr-close: -1

0 commit comments

Comments
 (0)