forked from rook/rook
tmate session is always enabled by mistake. This bug is introduced in the following PR. https://github.com/rook/rook/pull/14934 We should enable this if `inputs.debug-ci` is `true`. Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
28 lines
925 B
YAML
28 lines
925 B
YAML
name: "Tmate debugging tests"
|
|
description: "Setup tmate session if the test fails"
|
|
inputs:
|
|
use-tmate:
|
|
description: "boolean for enabling TMATE"
|
|
required: true
|
|
debug-ci:
|
|
description: "boolean for debug-ci label in PR"
|
|
requnred: false
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: consider debugging
|
|
shell: bash --noprofile --norc -eo pipefail -x {0}
|
|
if: runner.debug || inputs.debug-ci == 'true'
|
|
run: |
|
|
# Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run
|
|
if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ inputs.use-tmate }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then
|
|
echo USE_TMATE=1 >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: set up tmate session for debugging
|
|
if: env.USE_TMATE
|
|
uses: mxschmitt/action-tmate@v3
|
|
with:
|
|
limit-access-to-actor: false
|
|
detached: true
|