From 26bb3de68505bf22ab9f0fd578a2a65f244ff28a Mon Sep 17 00:00:00 2001 From: Mark Ridgwell Date: Thu, 26 Oct 2023 09:55:53 +0100 Subject: [PATCH 1/5] Fixing conditions --- .github/actions/build-tools/action.yml | 10 +-- .github/actions/build/action.yml | 75 +++++++++++++------ .github/actions/dotnet/action.yml | 38 +++++++--- .github/actions/npm/action.yml | 10 +-- .github/actions/sarif/action.yml | 2 +- .github/workflows/approve-dependabot.yml | 11 ++- .../build-and-publish-pre-release.yml | 2 +- .../workflows/build-and-publish-release.yml | 2 +- .../create-prs-for-stale-branches.yml | 4 +- .github/workflows/merge-dependabot.yml | 4 +- .github/workflows/pr-lint.yml | 30 ++++---- .github/workflows/pr-update.yml | 2 +- .github/workflows/reformat-sql.yml | 4 +- .github/workflows/reformat-yaml.yml | 4 +- 14 files changed, 123 insertions(+), 75 deletions(-) diff --git a/.github/actions/build-tools/action.yml b/.github/actions/build-tools/action.yml index 9ca7dc85..921c8ad0 100644 --- a/.github/actions/build-tools/action.yml +++ b/.github/actions/build-tools/action.yml @@ -104,7 +104,7 @@ runs: #### ADD FEEDS - name: "Dotnet: Add optional nuget feed (NugetCache)" - if: ${{inputs.NUGET_PUBLIC_RESTORE_FEED_CACHE != ''}} + if: inputs.NUGET_PUBLIC_RESTORE_FEED_CACHE != '' shell: bash run: | echo "Adding NugetCache NuGet feed..." @@ -117,14 +117,14 @@ runs: dotnet nuget add source --name nuget.org "${{inputs.NUGET_PUBLIC_RESTORE_FEED}}" - name: "Dotnet: Add optional nuget feed (Additional1Cache)" - if: ${{inputs.NUGET_ADDITIONAL_RESTORE_FEED_RELEASE_CACHE != ''}} + if: inputs.NUGET_ADDITIONAL_RESTORE_FEED_RELEASE_CACHE != '' shell: bash run: | echo "Adding Additional1Cache NuGet feed..." dotnet nuget add source --name Additional1Cache "${{inputs.NUGET_ADDITIONAL_RESTORE_FEED_RELEASE_CACHE}}" - name: "Dotnet: Add optional nuget feed (Additional2Cache)" - if: ${{inputs.NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE_CACHE != ''}} + if: inputs.NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE_CACHE != '' shell: bash run: | echo "Adding Additional2Cache NuGet feed..." @@ -132,14 +132,14 @@ runs: - name: "Dotnet: Add optional nuget feed (Additional1)" - if: ${{inputs.NUGET_ADDITIONAL_RESTORE_FEED_RELEASE != ''}} + if: inputs.NUGET_ADDITIONAL_RESTORE_FEED_RELEASE != '' shell: bash run: | echo "Adding Additional1 NuGet feed..." dotnet nuget add source --name Additional1 "${{inputs.NUGET_ADDITIONAL_RESTORE_FEED_RELEASE}}" - name: "Dotnet: Add optional nuget feed (Additional2)" - if: ${{inputs.NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE != ''}} + if: inputs.NUGET_ADDITIONAL_RESTORE_FEED_PRERELEASE != '' shell: bash run: | echo "Adding Additional2 NuGet feed..." diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 15e33d41..05499cd5 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -169,7 +169,9 @@ runs: [[ (${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true'}}) || steps.check_files.outputs.NPM_EXIST == 'true' ]] && echo 'BUILD_ENV=true' >> "$GITHUB_OUTPUT" || echo 'BUILD_ENV=false' >> "$GITHUB_OUTPUT" [[ (${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true'}}) || steps.check_files.outputs.NPM_EXIST == 'true' ]] && echo 'BUILD_ENV=true' >> "$GITHUB_OUTPUT" || echo 'BUILD_ENV=false' >> "$GITHUB_OUTPUT" - - if: ${{steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.NUGET_PACK == 'true'}} + - if: |- + steps.build_tools.outputs.BUILD_ENV == 'true' && + inputs.NUGET_PACK == 'true' name: "Install Multi-Push Tool" shell: bash run: dotnet tool install --local Credfeto.Package.Push @@ -184,14 +186,14 @@ runs: DOTNET_TieredPGO: "1" - name: "Get Unique Build Number" - if: ${{steps.build_tools.outputs.BUILD_ENV == 'true'}} + if: steps.build_tools.outputs.BUILD_ENV == 'true' uses: onyxmueller/build-tag-number@v1 id: build-number with: token: ${{inputs.GITHUB_TOKEN}} prefix: github - - if: ${{steps.build_tools.outputs.BUILD_ENV == 'true'}} + - if: steps.build_tools.outputs.BUILD_ENV == 'true' name: "Set Define Build Version" shell: bash run: dotnet buildversion --BuildNumber "${{steps.build-number.outputs.build_number}}" @@ -211,25 +213,25 @@ runs: { echo "DEPLOY=false"; } >> "$GITHUB_ENV" - name: "Deploy check - Is main or master" - if: ${{endsWith(env.BUILD_VERSION, '-main') || endsWith(env.BUILD_VERSION, '-master')}} + if: endsWith(env.BUILD_VERSION, '-main') || endsWith(env.BUILD_VERSION, '-master') shell: bash run: | { echo "DEPLOY=true"; echo "RELEASE=false"; } >> "$GITHUB_ENV" - name: Deploy check - Is release branch - if: ${{!contains(env.BUILD_VERSION, '-')}} + if: !contains(env.BUILD_VERSION, '-') shell: bash run: | { echo "DEPLOY=true"; echo "RELEASE=true"; } >> "$GITHUB_ENV" - name: "Deploy check - Is Dependabot" - if: ${{(github.actor == 'dependabot[bot]')}} + if: (github.actor == 'dependabot[bot]') shell: bash run: | { echo "DEPLOY=false"; } >> "$GITHUB_ENV" - name: "Install Package Builder" - if: ${{steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' }} + if: steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' shell: bash run: dotnet tool install --local FunFair.Content.Packager.Cmd --version ${{inputs.NPM_PRODUCTION_PACKAGER_VERSION}} env: @@ -243,7 +245,7 @@ runs: DOTNET_TieredPGO: "1" - name: "Install Package Store Signer" - if: ${{steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' }} + if: steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' shell: bash run: dotnet tool install --local FunFair.Content.PackageSigner.Cmd --version ${{inputs.NPM_PRODUCTION_PACKAGER_VERSION}} env: @@ -257,13 +259,13 @@ runs: DOTNET_TieredPGO: "1" - name: "Install Octopus Deploy CLI" - if: ${{steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} + if: steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != '' uses: OctopusDeploy/install-octocli@v3.0.0 with: version: latest - name: "Create Release Notes" - if: ${{steps.build_tools.outputs.BUILD_ENV == 'true'}} + if: steps.build_tools.outputs.BUILD_ENV == 'true' shell: bash run: dotnet changelog --changelog CHANGELOG.md --extract RELEASE_NOTES.md --version "${{env.BUILD_VERSION}}" env: @@ -277,7 +279,7 @@ runs: DOTNET_TieredPGO: "1" - name: "Read Release Notes" - if: ${{steps.build_tools.outputs.BUILD_ENV == 'true'}} + if: steps.build_tools.outputs.BUILD_ENV == 'true' id: release-notes uses: juliangruber/read-file-action@v1 with: @@ -287,7 +289,7 @@ runs: # DOTNET BUILD ############################################################################################################ - name: "Dotnet: Build" - if: ${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true'}} + if: steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true' uses: ./.github/actions/dotnet with: BUILD_VERSION: ${{env.BUILD_VERSION}} @@ -307,7 +309,7 @@ runs: # NPM BUILD ############################################################################################################ - name: "Npm: Build" - if: ${{steps.check_files.outputs.NPM_EXIST == 'true'}} + if: steps.check_files.outputs.NPM_EXIST == 'true' uses: ./.github/actions/npm with: BUILD_VERSION: ${{env.BUILD_VERSION}} @@ -325,7 +327,11 @@ runs: ############################################################################################################ - name: "Dotnet: Push package to Octopus (EXE and DB)" - if: ${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true' && steps.check_files.outputs.SQL_EXIST == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} + if: |- + steps.check_files.outputs.CSPROJ_EXIST == 'true' && + steps.check_files.outputs.SLN_EXIST == 'true' && + steps.check_files.outputs.SQL_EXIST == 'true' && + inputs.OCTOPUS_DEPLOY_PACKAGE != '' shell: bash run: octopus package upload --no-prompt --overwrite-mode=ignore --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-win-x64.${{env.BUILD_VERSION}}.zip" --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-x64.${{env.BUILD_VERSION}}.zip" --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-arm64.${{env.BUILD_VERSION}}.zip" --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-database.${{env.BUILD_VERSION}}.zip" env: @@ -334,7 +340,11 @@ runs: OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" - name: "Dotnet: Push package to Octopus (EXE ONLY)" - if: ${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true' && steps.check_files.outputs.SQL_EXIST != 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} + if: |- + steps.check_files.outputs.CSPROJ_EXIST == 'true' && + steps.check_files.outputs.SLN_EXIST == 'true' && + steps.check_files.outputs.SQL_EXIST != 'true' && + inputs.OCTOPUS_DEPLOY_PACKAGE != '' shell: bash run: octopus package upload --no-prompt --overwrite-mode=ignore --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-win-x64.${{env.BUILD_VERSION}}.zip" --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-x64.${{env.BUILD_VERSION}}.zip" --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-arm64.${{env.BUILD_VERSION}}.zip" env: @@ -343,7 +353,10 @@ runs: OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" - name: "Dotnet: Push package to Octopus (NPM NUPKG ONLY)" - if: ${{steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} + if: |- + steps.check_files.outputs.NPM_EXIST == 'true' && + steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' && + inputs.OCTOPUS_DEPLOY_PACKAGE != '' shell: bash run: octopus package upload --no-prompt --overwrite-mode=ignore --package="${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-${{env.BUILD_VERSION}}.nupkg" env: @@ -352,7 +365,13 @@ runs: OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" - name: "Dotnet: Create Octopus Release (EXE and DB)" - if: ${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true' && steps.check_files.outputs.SQL_EXIST == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != '' && inputs.OCTOPUS_CHANNEL != '' && env.DEPLOY == 'true'}} + if: |- + steps.check_files.outputs.CSPROJ_EXIST == 'true' && + steps.check_files.outputs.SLN_EXIST == 'true' && + steps.check_files.outputs.SQL_EXIST == 'true' && + inputs.OCTOPUS_DEPLOY_PACKAGE != '' && + inputs.OCTOPUS_CHANNEL != '' && + env.DEPLOY == 'true' shell: bash run: octopus release create --no-prompt --project="${{inputs.OCTOPUS_PROJECT}}" --version="${{env.BUILD_VERSION}}" --channel="${{inputs.OCTOPUS_CHANNEL}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-win-x64:${{env.BUILD_VERSION}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-x64:${{env.BUILD_VERSION}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-arm64:${{env.BUILD_VERSION}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-database:${{env.BUILD_VERSION}}" --release-notes-file="RELEASE_NOTES.md" env: @@ -361,7 +380,13 @@ runs: OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" - name: "Dotnet: Create Octopus Release (EXE ONLY)" - if: ${{steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true' && steps.check_files.outputs.SQL_EXIST != 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != '' && inputs.OCTOPUS_CHANNEL != '' && env.DEPLOY == 'true'}} + if: |- + steps.check_files.outputs.CSPROJ_EXIST == 'true' && + steps.check_files.outputs.SLN_EXIST == 'true' && + steps.check_files.outputs.SQL_EXIST != 'true' && + inputs.OCTOPUS_DEPLOY_PACKAGE != '' && + inputs.OCTOPUS_CHANNEL != '' && + env.DEPLOY == 'true' shell: bash run: octopus release create --no-prompt --project="${{inputs.OCTOPUS_PROJECT}}" --version="${{env.BUILD_VERSION}}" --channel="${{inputs.OCTOPUS_CHANNEL}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-win-x64:${{env.BUILD_VERSION}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-x64:${{env.BUILD_VERSION}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-linux-arm64:${{env.BUILD_VERSION}}" --release-notes-file="RELEASE_NOTES.md" env: @@ -370,7 +395,10 @@ runs: OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" - name: "Dotnet: Create Octopus Release (NPM ONLY)" - if: ${{steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' && inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} + if: |- + steps.check_files.outputs.NPM_EXIST == 'true' && + steps.check_files.outputs.NPM_SIGNING_EXIST == 'true' && + inputs.OCTOPUS_DEPLOY_PACKAGE != '' shell: bash run: octopus release create --no-prompt --project="${{inputs.OCTOPUS_PROJECT}}" --version="${{env.BUILD_VERSION}}" --channel="${{inputs.OCTOPUS_CHANNEL}}" --package="${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}:${{env.BUILD_VERSION}}" --release-notes-file="RELEASE_NOTES.md" env: @@ -379,7 +407,12 @@ runs: OCTOPUS_SPACE: "${{inputs.OCTOPUS_SPACE_NAME}}" - name: "Deploy Octopus Release" - if: ${{((steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true') || (steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true')) && inputs.OCTOPUS_DEPLOY_PACKAGE != '' && inputs.OCTOPUS_CHANNEL != '' && env.DEPLOY == 'true'}} + if: |- + ((steps.check_files.outputs.CSPROJ_EXIST == 'true' && steps.check_files.outputs.SLN_EXIST == 'true') || + (steps.check_files.outputs.NPM_EXIST == 'true' && steps.check_files.outputs.NPM_SIGNING_EXIST == 'true')) && + inputs.OCTOPUS_DEPLOY_PACKAGE != '' && + inputs.OCTOPUS_CHANNEL != '' && + env.DEPLOY == 'true' shell: bash run: octopus release deploy --no-prompt --project="${{inputs.OCTOPUS_PROJECT}}" --version="${{env.BUILD_VERSION}}" --environment="${{inputs.OCTOPUS_DEPLOY_TO}}" env: @@ -391,7 +424,7 @@ runs: # Create GitHub Release ############################################################################################################ - name: "Create Release" - if: ${{steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.CREATE_RELEASE == 'true'}} + if: {steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.CREATE_RELEASE == 'true' id: create_release uses: ncipollo/release-action@v1 with: diff --git a/.github/actions/dotnet/action.yml b/.github/actions/dotnet/action.yml index 21733828..b41f1088 100644 --- a/.github/actions/dotnet/action.yml +++ b/.github/actions/dotnet/action.yml @@ -60,13 +60,13 @@ runs: ############################################################################################################ - name: "Dotnet: Define Master build settings" - if: ${{env.Release == 'false'}} + if: env.Release == 'false' working-directory: ${{github.workspace}}/src shell: bash run: echo "DOTNET_RELEASE_DEFINES=/p:IsProduction=false" >> "$GITHUB_ENV" - name: "Dotnet: Define Release build settings" - if: ${{env.Release == 'false'}} + if: env.Release == 'false' working-directory: ${{github.workspace}}/src shell: bash run: echo "DOTNET_RELEASE_DEFINES=/p:IsProduction=True" >> "$GITHUB_ENV" @@ -120,7 +120,7 @@ runs: # # DATABASE BUILD # ############################################################################################################ - name: "SQL: Build" - if: ${{inputs.BUILD_SQL == 'true'}} + if: inputs.BUILD_SQL == 'true' uses: ./.github/actions/sql with: BUILD_VERSION: ${{inputs.BUILD_VERSION}} @@ -131,7 +131,7 @@ runs: # Publish ready for deploy to octopus ############################################################################################################ - name: "Dotnet: Pack Packages for Octopus (win-x64)" - if: ${{inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} + if: inputs.OCTOPUS_DEPLOY_PACKAGE != '' uses: ./.github/actions/dotnet-publish with: BUILD_VERSION: ${{inputs.BUILD_VERSION}} @@ -141,7 +141,7 @@ runs: OCTOPUS_DEPLOY_PACKAGE_ZIP: ${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}} - name: "Dotnet: Pack Packages for Octopus (linux-x64)" - if: ${{inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} + if: inputs.OCTOPUS_DEPLOY_PACKAGE != '' uses: ./.github/actions/dotnet-publish with: BUILD_VERSION: ${{inputs.BUILD_VERSION}} @@ -151,7 +151,7 @@ runs: OCTOPUS_DEPLOY_PACKAGE_ZIP: ${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}} - name: "Dotnet: Pack Packages for Octopus (linux-arm64)" - if: ${{inputs.OCTOPUS_DEPLOY_PACKAGE != ''}} + if: inputs.OCTOPUS_DEPLOY_PACKAGE != '' uses: ./.github/actions/dotnet-publish with: BUILD_VERSION: ${{inputs.BUILD_VERSION}} @@ -164,7 +164,7 @@ runs: # DOTNET PUSH TO NUGET ############################################################################################################ - name: "Dotnet: Pack tool" - if: ${{inputs.NUGET_PACK == 'true'}} + if: inputs.NUGET_PACK == 'true' working-directory: ${{github.workspace}}/src shell: bash run: dotnet pack --configuration Release "/p:Version=${{inputs.BUILD_VERSION}}" --no-restore -nodeReuse:False -p:NoWarn=MSB4241 @@ -180,7 +180,7 @@ runs: DOTNET_TieredPGO: "1" - name: "Dotnet: Copy packed to dist" - if: ${{inputs.NUGET_PACK == 'true'}} + if: inputs.NUGET_PACK == 'true' shell: bash run: | shopt -s globstar @@ -189,7 +189,11 @@ runs: working-directory: ${{github.workspace}}/src - name: "Dotnet: Publish Packages to Nuget (Without separate symbol feed)" - if: ${{inputs.NUGET_API_KEY != '' && inputs.NUGET_API_KEY != 'SLEET' && inputs.NUGET_PACK == 'true' && (inputs.NUGET_SYMBOL_FEED == '' || inputs.NUGET_SYMBOL_FEED == ' ')}} + if: |- + inputs.NUGET_API_KEY != '' && + inputs.NUGET_API_KEY != 'SLEET' && + inputs.NUGET_PACK == 'true' && + (inputs.NUGET_SYMBOL_FEED == '' || inputs.NUGET_SYMBOL_FEED == ' ') shell: bash run: dotnet pushpackages --folder dist --api-key "${{inputs.NUGET_API_KEY}}" --source ${{inputs.NUGET_FEED}} env: @@ -203,7 +207,11 @@ runs: DOTNET_TieredPGO: "1" - name: "Dotnet: Publish Packages to Nuget (With separate symbol feed)" - if: ${{inputs.NUGET_API_KEY != '' && inputs.NUGET_API_KEY != 'SLEET' && inputs.NUGET_PACK == 'true' && !(inputs.NUGET_SYMBOL_FEED == '' || inputs.NUGET_SYMBOL_FEED == ' ')}} + if: |- + inputs.NUGET_API_KEY != '' && + inputs.NUGET_API_KEY != 'SLEET' && + inputs.NUGET_PACK == 'true' && + !(inputs.NUGET_SYMBOL_FEED == '' || inputs.NUGET_SYMBOL_FEED == ' ') shell: bash run: dotnet pushpackages --folder dist --api-key "${{inputs.NUGET_API_KEY}}" --source ${{inputs.NUGET_FEED}} --symbol-source ${{inputs.NUGET_SYMBOL_FEED}} env: @@ -217,7 +225,10 @@ runs: DOTNET_TieredPGO: "1" - name: "Dotnet: Publish Packages Generate Sleet Config" - if: ${{inputs.NUGET_API_KEY == 'SLEET' && inputs.NUGET_PACK == 'true' && !(inputs.NUGET_SYMBOL_FEED == '' || inputs.NUGET_SYMBOL_FEED == ' ')}} + if: |- + inputs.NUGET_API_KEY == 'SLEET' && + inputs.NUGET_PACK == 'true' && + !(inputs.NUGET_SYMBOL_FEED == '' || inputs.NUGET_SYMBOL_FEED == ' ') uses: joutvhu/write-file@v1 with: path: sleet.json @@ -225,7 +236,10 @@ runs: write_mode: overwrite - name: "Dotnet: Publish Packages to Nuget (Using Sleet)" - if: ${{inputs.NUGET_API_KEY == 'SLEET' && inputs.NUGET_PACK == 'true' && !(inputs.NUGET_SYMBOL_FEED == '' || inputs.NUGET_SYMBOL_FEED == ' ')}} + if: |- + inputs.NUGET_API_KEY == 'SLEET' && + inputs.NUGET_PACK == 'true' && + !(inputs.NUGET_SYMBOL_FEED == '' || inputs.NUGET_SYMBOL_FEED == ' ') shell: bash run: dotnet sleet push "${{github.workspace}}/dist" --config sleet.json --source ${{inputs.SLEET_FEED}} env: diff --git a/.github/actions/npm/action.yml b/.github/actions/npm/action.yml index 56e63879..424969ce 100644 --- a/.github/actions/npm/action.yml +++ b/.github/actions/npm/action.yml @@ -60,7 +60,7 @@ runs: shell: bash run: npm run build - - if: ${{inputs.NPM_SIGNING == 'true'}} + - if: inputs.NPM_SIGNING == 'true' name: "NPM: Build Package" shell: bash run: dotnet buildcontentpackage -SourcePath "${{github.workspace}}/src/dist" -targetPath "${{github.workspace}}" -version "${{inputs.BUILD_VERSION}}" -WarningAsErrors false -Wallet "${{github.workspace}}/Wallet.json" -WalletPassword "${{inputs.NPM_CONTENT_PACKAGE_WALLET_PASSWORD}}" @@ -74,7 +74,7 @@ runs: DOTNET_TC_QuickJitForLoops: "1" DOTNET_TieredPGO: "1" - - if: ${{inputs.NPM_SIGNING == 'true'}} + - if: inputs.NPM_SIGNING == 'true' name: "NPM: Check Package" shell: bash run: | @@ -82,16 +82,16 @@ runs: echo "-----------------------" ls "${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-${{env.BUILD_VERSION}}.nupkg" - - if: ${{inputs.NPM_SIGNING == 'true'}} + - if: inputs.NPM_SIGNING == 'true' name: "NPM: Create Store Signing Wallet" - #uses: ttd2089/secret-file-action@1.0.0 + #uses: ttd2089/secret-file-action@1.0.0 uses: credfeto/secret-file-action@feat/fix-github-deprecations id: store-siging-wallet with: secret: ${{inputs.NPM_PACKAGE_STORE_SIGNING_WALLET}} b64-decode: false - - if: ${{inputs.NPM_SIGNING == 'true'}} + - if: inputs.NPM_SIGNING == 'true' name: "NPM: Store Sign Package" shell: bash run: dotnet signcontentpackage -Package "${{github.workspace}}/${{inputs.OCTOPUS_DEPLOY_PACKAGE_ZIP}}-${{inputs.BUILD_VERSION}}.nupkg" -WarningAsErrors true -Wallet false -Wallet "${{steps.store-siging-wallet.outputs.file}}" -WalletPassword "${{inputs.NPM_PACKAGE_STORE_SIGNING_WALLET_PASSWORD}}" diff --git a/.github/actions/sarif/action.yml b/.github/actions/sarif/action.yml index 24c036f1..c3fda1fa 100644 --- a/.github/actions/sarif/action.yml +++ b/.github/actions/sarif/action.yml @@ -22,7 +22,7 @@ runs: echo "Hash: ${{ hashfiles('**/*.sarif') }}" echo "SARIF_HASH=${{ hashfiles('**/*.sarif') }}" >> $GITHUB_ENV -# - if: ${{inputs.REPO_VISIBILITY == 'public' && env.SARIF_HASH != ''}} +# - if: inputs.REPO_VISIBILITY == 'public' && env.SARIF_HASH != '' # name: "Upload SARIF file for diagnostics" # id: sarif # uses: github/codeql-action/upload-sarif@v2 diff --git a/.github/workflows/approve-dependabot.yml b/.github/workflows/approve-dependabot.yml index ca9f48b2..10f03620 100644 --- a/.github/workflows/approve-dependabot.yml +++ b/.github/workflows/approve-dependabot.yml @@ -17,8 +17,8 @@ on: jobs: enable-auto-merge: if: |- - ${{endsWith(github.repository, '-template') && - startsWith(github.head_ref, 'dependabot/github_actions/')}} + endsWith(github.repository, '-template') && + startsWith(github.head_ref, 'dependabot/github_actions/') runs-on: [self-hosted, linux] permissions: @@ -42,8 +42,8 @@ jobs: auto_approve_dependabot: if: |- - ${{endsWith(github.repository, '-template') && - startsWith(github.head_ref, 'dependabot/github_actions/')}} + endsWith(github.repository, '-template') && + startsWith(github.head_ref, 'dependabot/github_actions/') runs-on: [self-hosted, linux] permissions: @@ -56,9 +56,8 @@ jobs: run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE" - name: "Check Repo Owner" shell: bash - run: echo "${{"github.repository_owner}}" + run: echo "${{github.repository_owner}}" - name: "Approve" uses: hmarr/auto-approve-action@v3 with: github-token: ${{secrets.SOURCE_PUSH_TOKEN}} - diff --git a/.github/workflows/build-and-publish-pre-release.yml b/.github/workflows/build-and-publish-pre-release.yml index ee4b1cec..840a139e 100644 --- a/.github/workflows/build-and-publish-pre-release.yml +++ b/.github/workflows/build-and-publish-pre-release.yml @@ -55,7 +55,7 @@ jobs: echo "OS: ${{runner.os}}" - name: "Enable Local nuget feeds if caching" - if: ${{startsWith(runner.name, 'buildagent-')}} + if: startsWith(runner.name, 'buildagent-') id: nuget-local-cache shell: bash run: | diff --git a/.github/workflows/build-and-publish-release.yml b/.github/workflows/build-and-publish-release.yml index 5369ea70..4637c6e8 100644 --- a/.github/workflows/build-and-publish-release.yml +++ b/.github/workflows/build-and-publish-release.yml @@ -44,7 +44,7 @@ jobs: echo "OS: ${{runner.os}}" - name: "Enable Local nuget feeds if caching" - if: ${{startsWith(runner.name, 'buildagent-')}} + if: startsWith(runner.name, 'buildagent-') id: nuget-local-cache shell: bash run: | diff --git a/.github/workflows/create-prs-for-stale-branches.yml b/.github/workflows/create-prs-for-stale-branches.yml index f2a28fdb..e7632432 100644 --- a/.github/workflows/create-prs-for-stale-branches.yml +++ b/.github/workflows/create-prs-for-stale-branches.yml @@ -165,10 +165,10 @@ jobs: - name: "Create PR" if: |- - ${{steps.detection.outputs.defaultbranch != matrix.branch + steps.detection.outputs.defaultbranch != matrix.branch && steps.find-pull-request.outputs.number == '' && steps.aheadbehind.outputs.ahead != 0 - && steps.aheadbehind.outputs.dayssinceupdate > 7}} + && steps.aheadbehind.outputs.dayssinceupdate > 7 id: open-pr uses: repo-sync/pull-request@v2.12 with: diff --git a/.github/workflows/merge-dependabot.yml b/.github/workflows/merge-dependabot.yml index 8d44bf74..5be2ffcb 100644 --- a/.github/workflows/merge-dependabot.yml +++ b/.github/workflows/merge-dependabot.yml @@ -25,8 +25,8 @@ on: jobs: auto_merge_dependabot: if: |- - ${{endsWith(github.repository, '-template') && - startsWith(github.head_ref, 'dependabot/github_actions/')}} + endsWith(github.repository, '-template') && + startsWith(github.head_ref, 'dependabot/github_actions/') runs-on: [self-hosted, linux] permissions: diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index ed66561b..dd99e64d 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -17,7 +17,7 @@ env: BASE_REF: ${{github.base_ref}} jobs: info: - if: ${{endsWith(github.repository, '-template')}} + if: endsWith(github.repository, '-template') runs-on: [self-hosted, linux] steps: - name: "Initialise Workspace" @@ -43,9 +43,9 @@ jobs: # with: # fetch-depth: 0 # - if: |- -# ${{!endsWith(github.repository, '-template') +# !endsWith(github.repository, '-template') # && !startsWith(github.head_ref, 'release/') -# && !startsWith(github.head_ref, 'hotfix/')}} +# && !startsWith(github.head_ref, 'hotfix/') # uses: seferov/pr-lint-action@v1.2.0 # with: # title-regex: '^\[FF\-\d*?\](:)?(\ )' @@ -58,14 +58,14 @@ jobs: - name: "Initialise Workspace" shell: bash run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE" - - if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}} + - if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template')) uses: actions/checkout@v4 with: fetch-depth: 0 - - if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}} + - if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template')) shell: bash run: echo "CHANGES=$(git diff --exit-code --no-patch --merge-base origin/main CHANGELOG.md 2> /dev/null && echo 0 || echo $?)" >> "$GITHUB_ENV" - - if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template')) && env.CHANGES == '0'}} + - if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template')) && env.CHANGES == '0' uses: actions/github-script@v6.4.1 with: script: | @@ -84,13 +84,13 @@ jobs: with: fetch-depth: 0 - name: "Get version from global.json" - if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}} + if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template')) uses: credfeto/action-dotnet-version-detect@v1.3.0 with: file: src/global.json fallback: 7.0.* - name: "Install dotnet" - if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}} + if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template')) uses: actions/setup-dotnet@v3.2.0 env: GITHUB_TOKEN: ${{secrets.SOURCE_PUSH_TOKEN}} @@ -108,7 +108,7 @@ jobs: 7.0.* ${{env.DOTNET_VERSION}} - name: "Enable dotnet tools" - if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}} + if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template')) shell: bash run: dotnet new tool-manifest env: @@ -121,7 +121,7 @@ jobs: DOTNET_TC_QuickJitForLoops: "1" DOTNET_TieredPGO: "1" - name: "Install Changelog tool" - if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}} + if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template')) shell: bash run: dotnet tool install --local Credfeto.ChangeLog.Cmd env: @@ -134,7 +134,7 @@ jobs: DOTNET_TC_QuickJitForLoops: "1" DOTNET_TieredPGO: "1" - name: "Check Changelog" - if: ${{(github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template'))}} + if: (github.actor != 'dependabot[bot]' && !endsWith(github.repository , '-template')) shell: bash run: dotnet changelog --changelog CHANGELOG.md --check-insert "origin/${{github.base_ref}}" env: @@ -227,12 +227,12 @@ jobs: # optional parameter defaults to the current user token: ${{github.token}} - name: "Checkout Source" - if: ${{steps.visibility.outputs.is_public == 'true'}} + if: steps.visibility.outputs.is_public == 'true' uses: actions/checkout@v4 with: fetch-depth: 0 - name: 'Dependency Review' - if: ${{steps.visibility.outputs.is_public == 'true'}} + if: steps.visibility.outputs.is_public == 'true' uses: actions/dependency-review-action@v3.1.0 no-merge-commits: @@ -251,7 +251,9 @@ jobs: uses: greenled/no-merge-commits-check@v1.0.1 lint-code: - if: ${{github.event.pull_request.draft == false && ( !startsWith(github.head_ref, 'release/') && !startsWith(github.head_ref, 'hotfix/') )}} + if: |- + github.event.pull_request.draft == false && + ( !startsWith(github.head_ref, 'release/') && !startsWith(github.head_ref, 'hotfix/') ) runs-on: [self-hosted, linux] steps: - name: "Initialise Workspace" diff --git a/.github/workflows/pr-update.yml b/.github/workflows/pr-update.yml index 48bf7b0c..1332a33f 100644 --- a/.github/workflows/pr-update.yml +++ b/.github/workflows/pr-update.yml @@ -17,7 +17,7 @@ env: BASE_REF: ${{github.base_ref}} jobs: info: - if: ${{endsWith(github.repository , '-template')}} + if: endsWith(github.repository , '-template') runs-on: [self-hosted, linux] steps: - name: "Initialise Workspace" diff --git a/.github/workflows/reformat-sql.yml b/.github/workflows/reformat-sql.yml index 414f6e75..8eb6522c 100644 --- a/.github/workflows/reformat-sql.yml +++ b/.github/workflows/reformat-sql.yml @@ -19,10 +19,10 @@ jobs: standardise-tsql-files: if: |- - ${{github.event.pull_request.draft == false + github.event.pull_request.draft == false && ( !startsWith(github.head_ref, 'release/') && !startsWith(github.head_ref, 'hotfix/') ) - && github.actor != 'dependabot[bot]'}} + && github.actor != 'dependabot[bot]' runs-on: [self-hosted, linux] steps: diff --git a/.github/workflows/reformat-yaml.yml b/.github/workflows/reformat-yaml.yml index a224cea6..0cb14b32 100644 --- a/.github/workflows/reformat-yaml.yml +++ b/.github/workflows/reformat-yaml.yml @@ -20,10 +20,10 @@ jobs: standardise-yaml-files: if: |- - ${{github.event.pull_request.draft == false + github.event.pull_request.draft == false && ( !startsWith(github.head_ref, 'release/') && !startsWith(github.head_ref, 'hotfix/') ) - && github.actor != 'dependabot[bot]'}} + && github.actor != 'dependabot[bot]' runs-on: [self-hosted, linux] steps: From 488d7790550fbb30d135cb6a4aeda39acc2684bc Mon Sep 17 00:00:00 2001 From: Mark Ridgwell Date: Thu, 26 Oct 2023 09:57:37 +0100 Subject: [PATCH 2/5] Fixing conditions --- .github/actions/build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 05499cd5..6185dbb0 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -219,7 +219,7 @@ runs: { echo "DEPLOY=true"; echo "RELEASE=false"; } >> "$GITHUB_ENV" - name: Deploy check - Is release branch - if: !contains(env.BUILD_VERSION, '-') + if: !contains(env.BUILD_VERSION, "-") shell: bash run: | { echo "DEPLOY=true"; echo "RELEASE=true"; } >> "$GITHUB_ENV" From aa5935bea475349759d29ead41077aa27504d34a Mon Sep 17 00:00:00 2001 From: Mark Ridgwell Date: Thu, 26 Oct 2023 09:59:37 +0100 Subject: [PATCH 3/5] Fixing conditions --- .github/actions/build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 6185dbb0..fa0f1358 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -219,7 +219,7 @@ runs: { echo "DEPLOY=true"; echo "RELEASE=false"; } >> "$GITHUB_ENV" - name: Deploy check - Is release branch - if: !contains(env.BUILD_VERSION, "-") + if: contains(env.BUILD_VERSION, '-') == false shell: bash run: | { echo "DEPLOY=true"; echo "RELEASE=true"; } >> "$GITHUB_ENV" From 9e60b6400050e6611325a6ecdbb467d1132f2941 Mon Sep 17 00:00:00 2001 From: Mark Ridgwell Date: Thu, 26 Oct 2023 10:02:12 +0100 Subject: [PATCH 4/5] Fixing conditions --- .github/actions/build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index fa0f1358..8f3a43d9 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -424,7 +424,7 @@ runs: # Create GitHub Release ############################################################################################################ - name: "Create Release" - if: {steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.CREATE_RELEASE == 'true' + if: steps.build_tools.outputs.BUILD_ENV == 'true' && inputs.CREATE_RELEASE == 'true' id: create_release uses: ncipollo/release-action@v1 with: From 0b6da30045880427c05c98f8b0ea091a5ddb59b6 Mon Sep 17 00:00:00 2001 From: Mark Ridgwell Date: Thu, 26 Oct 2023 10:06:43 +0100 Subject: [PATCH 5/5] Fixing conditions --- .github/workflows/merge-dependabot.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/merge-dependabot.yml b/.github/workflows/merge-dependabot.yml index 5be2ffcb..8f9081c1 100644 --- a/.github/workflows/merge-dependabot.yml +++ b/.github/workflows/merge-dependabot.yml @@ -14,13 +14,13 @@ on: - ready_for_review - reopened - unlocked - pull_request_review: + pull_request_review: types: - submitted - check_suite: + check_suite: types: - completed - status: { } + status: { } jobs: auto_merge_dependabot: