[release/7.x] Replace SwaggerUI and SwaggerScope option with OpenAPI document #1184
Workflow file for this run
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
name: 'C# linting' | |
on: | |
pull_request: | |
paths: ['src/**.cs'] | |
branches: [ 'release/7*', 'release/6*' ] | |
permissions: | |
pull-requests: read | |
jobs: | |
lint-csharp: | |
if: contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) | |
name: 'C# Linting' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
with: | |
persist-credentials: false | |
- name: Get base commit for the PR | |
run: | | |
git fetch origin "$GITHUB_BASE_REF" | |
base_sha=$(git rev-parse "origin/$GITHUB_BASE_REF") | |
echo "base_sha=$base_sha" >> $GITHUB_ENV | |
echo "Merging ${GITHUB_SHA} into ${GITHUB_BASE_REF}" | |
- name: Get changed files | |
run: | | |
changed_source_files=$(git diff-tree --no-commit-id --name-only -r "$base_sha" "$GITHUB_SHA" | { grep "**.cs$" || test $? = 1; }) | |
echo "Files to validate: '${changed_source_files}'" | |
echo "updated_files=$(echo ${changed_source_files})" >> $GITHUB_ENV | |
- name: Run dotnet restore | |
run: ./dotnet.sh restore | |
- name: Run dotnet format (whitespace) | |
run: ./dotnet.sh format whitespace --no-restore --include $updated_files | |
- name: Run dotnet format (style) | |
run: ./dotnet.sh format style --no-restore --include $updated_files | |
- name: Generate artifacts | |
run: | | |
mkdir -p ./pr | |
cp "$GITHUB_EVENT_PATH" ./pr/pr-event.json | |
git diff > ./pr/linter.diff | |
- name: Upload artifacts | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 | |
with: | |
name: pr-linter | |
path: pr/ |