diff --git a/.github/workflows/setup-tofu.yml b/.github/workflows/setup-tofu.yml index 87a8f2d..2cec032 100644 --- a/.github/workflows/setup-tofu.yml +++ b/.github/workflows/setup-tofu.yml @@ -5,13 +5,6 @@ on: branches: - main pull_request: - workflow_dispatch: - inputs: - debug: - description: 'Enable debug logs for steps' - type: boolean - required: false - default: false defaults: run: @@ -35,7 +28,7 @@ jobs: - name: Setup OpenTofu - ${{ matrix['tofu-versions'] }} env: - ACTIONS_STEP_DEBUG: ${{ inputs.debug }} + ACTIONS_STEP_DEBUG: $ACTIONS_STEP_DEBUG uses: ./ with: tofu_version: ${{ matrix['tofu-versions'] }} @@ -60,7 +53,7 @@ jobs: - name: Setup OpenTofu env: - ACTIONS_STEP_DEBUG: ${{ inputs.debug }} + ACTIONS_STEP_DEBUG: $ACTIONS_STEP_DEBUG uses: ./ with: tofu_wrapper: ${{ matrix['tofu-wrapper'] }} @@ -85,7 +78,7 @@ jobs: tofu-run-local: name: 'OpenTofu Run Local' env: - ACTIONS_STEP_DEBUG: ${{ inputs.debug }} + ACTIONS_STEP_DEBUG: $ACTIONS_STEP_DEBUG runs-on: ${{ matrix.os }} strategy: matrix: @@ -125,7 +118,7 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] env: TF_CLOUD_API_TOKEN: 'XXXXXXXXXXXXXX.atlasv1.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' - ACTIONS_STEP_DEBUG: ${{ inputs.debug }} + ACTIONS_STEP_DEBUG: $ACTIONS_STEP_DEBUG steps: - name: Checkout uses: actions/checkout@v4 @@ -155,7 +148,7 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] env: TF_CLOUD_API_TOKEN: 'XXXXXXXXXXXXXX.atlasv1.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' - ACTIONS_STEP_DEBUG: ${{ inputs.debug }} + ACTIONS_STEP_DEBUG: $ACTIONS_STEP_DEBUG steps: - name: Checkout uses: actions/checkout@v4 @@ -181,7 +174,7 @@ jobs: tofu-credentials-none: name: 'OpenTofu No Credentials' env: - ACTIONS_STEP_DEBUG: ${{ inputs.debug }} + ACTIONS_STEP_DEBUG: $ACTIONS_STEP_DEBUG runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/action.yml b/action.yml index 2a0497d..bebcc78 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,10 @@ inputs: description: 'API token for GitHub to increase the rate limit. Defaults to the GITHUB_TOKEN environment variable unless running on Forgejo/Gitea.' default: '' required: false + step_debug_logging: + description: 'This increases job log verbosity during and after execution when set to `true`. Defaults to `false`' + default: 'false' + required: false outputs: stdout: description: 'The STDOUT stream of the call to the `tofu` binary.' diff --git a/lib/setup-tofu.js b/lib/setup-tofu.js index 37f56e1..2d4b43c 100644 --- a/lib/setup-tofu.js +++ b/lib/setup-tofu.js @@ -155,6 +155,9 @@ async function run () { // Download requested version const pathToCLI = await downloadAndExtractCLI(build.url); + const stepDebugLogging = core.getInput('step_debug_logging'); + core.exportVariable('ACTIONS_STEP_DEBUG', stepDebugLogging); + // Install our wrapper if (wrapper) { await installWrapper(pathToCLI);