Skip to content
Merged
Changes from all commits
Commits
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
34 changes: 26 additions & 8 deletions .github/workflows/update-nuspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
workflows: ["service::event_dispatcher::pull_request::closed::main"]
types:
- completed
workflow_dispatch:
inputs:
force:
description: 'Force update all nuspec files'
required: false
type: boolean
default: false

concurrency:
group: update-nuspec
Expand All @@ -13,7 +20,7 @@ concurrency:
jobs:
validate:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
if: github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch'
outputs:
result: ${{ steps.validate.outputs.result }}
steps:
Expand All @@ -27,7 +34,9 @@ jobs:
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "[skip] workflow_dispatch"
echo "[workflow_dispatch] Skipping PR validation"
echo "pull_request_merged=true" >> $GITHUB_OUTPUT
echo "pull_request_head_ref=" >> $GITHUB_OUTPUT
exit 0
fi

Expand Down Expand Up @@ -85,30 +94,39 @@ jobs:
- uses: actions/checkout@v4

- uses: ./.github/actions/has-changes
if: github.event.inputs.force != 'true'
id: has-changes-module
with:
project: EncryptedConfigValue.Module

- uses: ./.github/actions/has-changes
if: github.event.inputs.force != 'true'
id: has-changes-aspnetcore
with:
project: EncryptedConfigValue.AspNetCore

- uses: ./.github/actions/has-changes
if: github.event.inputs.force != 'true'
id: has-changes-cli
with:
project: EncryptedConfigValue.Cli

- name: Finalize
id: finalize
run: |
echo "module=${{ steps.has-changes-module.outputs.result }}" >> $GITHUB_OUTPUT
echo "aspnetcore=${{ steps.has-changes-aspnetcore.outputs.result }}" >> $GITHUB_OUTPUT
echo "cli=${{ steps.has-changes-cli.outputs.result }}" >> $GITHUB_OUTPUT
if [[ "${{ github.event.inputs.force }}" == "true" ]]; then
echo "module=true" >> $GITHUB_OUTPUT
echo "aspnetcore=true" >> $GITHUB_OUTPUT
echo "cli=true" >> $GITHUB_OUTPUT
else
echo "module=${{ steps.has-changes-module.outputs.result }}" >> $GITHUB_OUTPUT
echo "aspnetcore=${{ steps.has-changes-aspnetcore.outputs.result }}" >> $GITHUB_OUTPUT
echo "cli=${{ steps.has-changes-cli.outputs.result }}" >> $GITHUB_OUTPUT
fi

module:
needs: [has-changes]
if: inputs.force == true || needs.has-changes.outputs.module == 'true'
if: github.event.inputs.force == 'true' || needs.has-changes.outputs.module == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down Expand Up @@ -164,7 +182,7 @@ jobs:

aspnetcore:
needs: [has-changes]
if: inputs.force == true || needs.has-changes.outputs.aspnetcore == 'true'
if: github.event.inputs.force == 'true' || needs.has-changes.outputs.aspnetcore == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down Expand Up @@ -218,7 +236,7 @@ jobs:

cli:
needs: [has-changes]
if: inputs.force == true || needs.has-changes.outputs.cli == 'true'
if: github.event.inputs.force == 'true' || needs.has-changes.outputs.cli == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
Loading