From 2863f616e98d1169a3714aed1a4650622132ba40 Mon Sep 17 00:00:00 2001 From: dormant-user Date: Mon, 26 Aug 2024 13:49:03 -0500 Subject: [PATCH] CI/CD: Allow workflow_dispatch to set `dry_run` --- .github/workflows/python-publish.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index 0ce5e26..da45954 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -11,6 +11,14 @@ on: - '**/*.py' - 'pyproject.toml' workflow_dispatch: + inputs: + dry_run: + type: choice + description: Dry run mode + required: true + options: + - "true" + - "false" jobs: pypi-publisher: @@ -18,7 +26,10 @@ jobs: steps: - name: Set dry-run run: | - if [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "::notice title=DryRun::Setting dry run to ${{ inputs.dry_run }} for '${{ github.event_name }}' event" + echo "dry_run=${{ inputs.dry_run }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "push" ]]; then echo "::notice title=DryRun::Setting dry run to true for '${{ github.event_name }}' event" echo "dry_run=true" >> $GITHUB_ENV else