-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from subhamkrai/add-tmate
ci: access tmate when ci is debug mode or label `debug-ci` is added
- Loading branch information
Showing
2 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: "Tmate debugging tests" | ||
description: "Setup tmate session if the test fails" | ||
inputs: | ||
use-tmate: | ||
description: "boolean for enabling TMATE" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: consider debugging | ||
shell: bash --noprofile --norc -eo pipefail -x {0} | ||
if: runner.debug || contains(github.event.pull_request.labels.*.name, 'debug-ci') | ||
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 |