Skip to content

Commit a627983

Browse files
committed
.Net CI
1 parent 29e5fd0 commit a627983

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3239
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: .NET CI
2+
on:
3+
push:
4+
branches: [ "main" ]
5+
pull_request:
6+
branches: [ "main" ]
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Setup .NET
13+
uses: actions/setup-dotnet@v3
14+
with:
15+
dotnet-version: 8.0.x
16+
- name: Restore
17+
run: dotnet restore UserApp/UserApp.csproj
18+
- name: Build
19+
run: dotnet build UserApp/UserApp.csproj --no-restore
20+
- name: Test
21+
run: dotnet test UserApp/UserApp.csproj --no-build --verbosity normal

CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# CONTRIBUTING.md
2+
3+
Thank you for your interest in contributing to UserApp!
4+
5+
## How to Contribute
6+
7+
1. **Fork the repository** and create your branch from `main`.
8+
2. **Follow the project structure**: organize code into Models, Services, and Controllers.
9+
3. **Write clear, secure code**: avoid hardcoded secrets and use parameterized queries for database access.
10+
4. **Document your code**: use XML comments for public methods and update documentation as needed.
11+
5. **Test your changes**: run `dotnet test` before submitting a pull request.
12+
6. **Check for security issues**: ensure CodeQL and secret scanning pass in CI.
13+
7. **Submit a pull request**: describe your changes and reference related issues.
14+
15+
## Code of Conduct
16+
17+
- Be respectful and collaborative.
18+
- Follow secure coding practices.
19+
- Report vulnerabilities responsibly.
20+
21+
## Resources
22+
23+
- [README.md](./README.md)
24+
- [INSTRUCTIONS.md](./INSTRUCTIONS.md)
25+
- [GitHub Security Documentation](https://docs.github.com/en/code-security)
26+
27+
---
28+
We appreciate your contributions to making UserApp secure and reliable!

INSTRUCTIONS.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# INSTRUCTIONS.md
2+
3+
## Project Setup
4+
5+
1. Clone the repository:
6+
```bash
7+
git clone <repo-url>
8+
cd secure-dotnet-api-codeql
9+
```
10+
2. Install .NET 8 SDK if not already installed.
11+
3. Restore dependencies:
12+
```bash
13+
dotnet restore UserApp/UserApp.csproj
14+
```
15+
4. Build the project:
16+
```bash
17+
dotnet build UserApp/UserApp.csproj
18+
```
19+
5. Run the API:
20+
```bash
21+
dotnet run --project UserApp/UserApp.csproj
22+
```
23+
24+
## Usage
25+
26+
- Access the API endpoints:
27+
- Get user by ID: `GET /api/user?id=1`
28+
- Get user by email: `GET /api/user/[email protected]`
29+
- API configuration is managed in `UserApp/appsettings.json`.
30+
- Swagger UI is available at `/swagger` for interactive API documentation.
31+
32+
## Security & Code Quality
33+
34+
- CodeQL and Dependabot are enabled for automated security and dependency updates.
35+
- Secret scanning and push protection are enforced via GitHub settings.
36+
- Custom CodeQL queries detect hardcoded secrets.
37+
38+
---
39+
For more details, see the README.md and CONTRIBUTING.md files.

0 commit comments

Comments
 (0)