Skip to content
Open

m #6

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
bb64fc3
API changes
ayaziz May 15, 2022
1bb53b0
Merge pull request #4 from atef-aziz-eg/apichanges
ayaziz May 15, 2022
c46a975
dummy actios
ayaziz May 15, 2022
063da54
Merge pull request #5 from atef-aziz-eg/github-actions-demo
ayaziz May 15, 2022
b39a72c
Update github-actions-demo.yml
ayaziz May 16, 2022
fb6ad4d
Update dotnet.yml
ayaziz May 22, 2022
f108211
Create node.js.yml
ayaziz May 22, 2022
dd89d1a
Update dotnet.yml
ayaziz May 22, 2022
eb6e558
Update dotnet.yml
ayaziz May 22, 2022
8f72ac1
Update dotnet.yml
ayaziz May 22, 2022
cf89950
Update dotnet.yml
ayaziz May 22, 2022
5c3135c
Update dotnet.yml
ayaziz May 22, 2022
0f81a9c
Update dotnet.yml
ayaziz May 22, 2022
1f57fbc
Update dotnet.yml
ayaziz May 22, 2022
668da3f
Update dotnet.yml
ayaziz May 22, 2022
d4f8e59
Update dotnet.yml
ayaziz May 22, 2022
2f0aae1
Update dotnet.yml
ayaziz May 22, 2022
d25476e
Update dotnet.yml
ayaziz May 22, 2022
834697d
Update dotnet.yml
ayaziz May 22, 2022
6c7d4af
Update dotnet.yml
ayaziz May 22, 2022
0a36cbc
Create script.sh
ayaziz May 22, 2022
e2ee623
Update dotnet.yml
ayaziz May 22, 2022
9928ead
Update dotnet.yml
ayaziz May 22, 2022
4ecf1ca
Delete node.js.yml
ayaziz May 22, 2022
3f66808
Delete github-actions-demo.yml
ayaziz May 22, 2022
f7261ee
Update dotnet.yml
ayaziz May 22, 2022
ae2c565
Update dotnet.yml
ayaziz May 22, 2022
defcd7c
Update dotnet.yml
ayaziz May 22, 2022
42e5e8a
Update dotnet.yml
ayaziz May 22, 2022
5b4e637
Update dotnet.yml
ayaziz May 22, 2022
4819aea
Update dotnet.yml
ayaziz May 22, 2022
92fc361
Update dotnet.yml
ayaziz May 22, 2022
c471a12
Update dotnet.yml
ayaziz May 22, 2022
38d7c89
Update dotnet.yml
ayaziz May 22, 2022
b50797b
Create main.sh
ayaziz May 22, 2022
5b53a51
Update dotnet.yml
ayaziz May 22, 2022
130e5f1
Update dotnet.yml
ayaziz May 22, 2022
eb00a13
Update dotnet.yml
ayaziz May 22, 2022
6f6e57c
Update dotnet.yml
ayaziz May 22, 2022
4f4ba4c
Update dotnet.yml
ayaziz May 22, 2022
7d6e461
Update README.md
ayaziz May 22, 2022
52afa7a
Create script_pipeline.yml
ayaziz May 23, 2022
43b03cc
Update script_pipeline.yml
ayaziz May 23, 2022
664c714
Update script_pipeline.yml
ayaziz May 23, 2022
20988c7
Update script_pipeline.yml
ayaziz May 23, 2022
7c76059
Update script_pipeline.yml
ayaziz May 23, 2022
54fd256
Update script_pipeline.yml
ayaziz May 23, 2022
8b34ce1
Update script_pipeline.yml
ayaziz May 23, 2022
76df668
Update script_pipeline.yml
ayaziz May 23, 2022
5930280
Update script_pipeline.yml
ayaziz May 23, 2022
10ca00b
Update script_pipeline.yml
ayaziz May 23, 2022
9595620
Update script_pipeline.yml
ayaziz May 23, 2022
a3c1b88
Update script_pipeline.yml
ayaziz May 23, 2022
47e7aec
Update script_pipeline.yml
ayaziz May 23, 2022
e1176a2
Update dotnet.yml
ayaziz May 23, 2022
dbe001a
Update dotnet.yml
ayaziz May 23, 2022
8c05aaa
Update dotnet.yml
ayaziz May 23, 2022
c5460ca
Update dotnet.yml
ayaziz May 23, 2022
5c31c01
Create release-drafter.yml
ayaziz May 23, 2022
2b45dcb
Create codeql.yml
ayaziz May 24, 2022
9bef3cd
Create SECURITY.md
ayaziz May 24, 2022
b9be751
Delete codeql.yml
ayaziz May 24, 2022
6082187
Create codeql.yml
ayaziz May 24, 2022
a0ffbea
XX
ayaziz May 24, 2022
6e9fd04
Merge pull request #18 from atef-aziz-eg/newB
ayaziz May 24, 2022
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
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
template: |
## What’s Changed
$CHANGES
1 change: 1 addition & 0 deletions .github/script/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ls
72 changes: 72 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '36 12 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
62 changes: 54 additions & 8 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,71 @@
name: .NET

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest
update_release_draft:
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
dotnet-version: [6.0.x]
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@main
- name: Setup .NET
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@main
with:
dotnet-version: 5.0.x
dotnet-version: ${{matrix.dotnet-version}}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: dotnet test
run: dotnet test
publish:
needs: build
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
dotnet-version: [6.0.x]
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: run file
run: echo ${{ github.server_url }}/${{ github.repository }}
- name: Setup .Net
uses: actions/setup-dotnet@main
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Build
run: dotnet publish
- name: Nuget Package And Upload
uses: csharp-opensource/publish-nuget@master
with:
releaseVersion: ${{ github.event.release.tag_name }}
repoUrl: ${{ github.server_url }}/${{ github.repository }}
nugetToken: ${{ secrets.NUGET_AUTH_TOKEN }}
nugetSource: https://api.nuget.org/v3/index.json
1 change: 1 addition & 0 deletions .github/workflows/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ls
25 changes: 25 additions & 0 deletions .github/workflows/script_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: write comments
on:
issues:
types: [opened, closed]
permissions:
actions: write
issues: write
statuses: write
jobs:
comment_issue:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: ["ubuntu-latest"]
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '👋 Thanks for reporting!'
})
35 changes: 35 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/GitActions.API/bin/Debug/net5.0/GitActions.API.dll",
"args": [],
"cwd": "${workspaceFolder}/GitActions.API",
"stopAtEntry": false,
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
41 changes: 41 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/GitActions.API/GitActions.API.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/GitActions.API/GitActions.API.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/GitActions.API/GitActions.API.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
12 changes: 12 additions & 0 deletions GitActions.API/Controllers/WeatherForecastController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System.Collections.Generic;
using System.Linq;
using System;
using Microsoft.Data.SqlClient;

namespace GitActions.API.Controllers
{
[ApiController]
Expand All @@ -24,6 +26,16 @@ public WeatherForecastController(ILogger<WeatherForecastController> logger)
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{

using (var connection = new SqlConnection("Server=tcp:sqlazewtmlns001scmshard.database.windows.net,1433;Initial Catalog=sqdazewtmlns001destcr;Persist Security Info=False;User ID=SQL_Destination_Admin_CR;Password=X1Zkk1dvS7FmO9vHapAhNJqUk4LU8pcCGYXXZhcFWtFsO;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"))
{
connection.Open();
using (var command = new SqlCommand($"insert int * from temp where id={10}", connection))
{
command.ExecuteNonQuery();
}
}

return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
Expand Down
3 changes: 3 additions & 0 deletions GitActions.API/GitActions.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.17" />
<PackageReference Include="Microsoft.OpenApi" Version="1.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# gitactions
![example branch parameter.](https://github.com/mona/special-octo-eureka/actions/workflows/grading.yml/badge.svg?branch=my-workflow)
21 changes: 21 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.