Sync dev and main #256
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: Detect Doc Generator Changes | |
on: [pull_request] | |
permissions: | |
id-token: write | |
jobs: | |
detect-documentation-changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@8c3f20df09ac63af7b3ae3d7c91f105f857d8497 #v4 | |
with: | |
role-to-assume: ${{ secrets.CI_MAIN_TESTING_ACCOUNT_ROLE_ARN }} | |
role-duration-seconds: 7200 | |
aws-region: us-west-2 | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
- name: Setup .NET Core 6.0 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Run Client Generator | |
run: | | |
cd ./src/AWS.Deploy.DocGenerator | |
dotnet run --project ./AWS.Deploy.DocGenerator.csproj | |
- name: Check For Git Untracked Changes | |
id: gitcheck | |
shell: pwsh | |
run: | | |
$newFiles=$(git ls-files --others --exclude-standard | wc -l) | |
$modifiedFiles=$(git diff --name-only | wc -l) | |
"newFiles=$newFiles" >> $env:GITHUB_OUTPUT | |
"modifiedFiles=$modifiedFiles" >> $env:GITHUB_OUTPUT | |
- name: Fail If New Files Detected | |
if: steps.gitcheck.outputs.newFiles != 0 | |
run: | | |
echo "New files have been generated after running 'AWS.Deploy.DocGenerator'. Make sure to add the new files to your working branch." | |
exit 1 | |
- name: Fail If Modified Files Detected | |
if: steps.gitcheck.outputs.modifiedFiles != 0 | |
run: | | |
echo "Updated files have been generated after running 'AWS.Deploy.DocGenerator'. Make sure to commit the updated files to your working branch." | |
exit 1 |