action.yml 877 B

123456789101112131415161718192021222324
  1. name: "Tmate debugging tests"
  2. description: "Setup tmate session if the test fails"
  3. inputs:
  4. use-tmate:
  5. description: "boolean for enabling TMATE"
  6. required: true
  7. runs:
  8. using: "composite"
  9. steps:
  10. - name: consider debugging
  11. shell: bash --noprofile --norc -eo pipefail -x {0}
  12. if: runner.debug || contains(github.event.pull_request.labels.*.name, 'debug-ci')
  13. run: |
  14. # Enable tmate only in the Rook fork, where the USE_TMATE secret is set in the repo, or if the action is re-run
  15. if [ "$GITHUB_REPOSITORY_OWNER" = "rook" ] || [ -n "${{ inputs.use-tmate }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then
  16. echo USE_TMATE=1 >> $GITHUB_ENV
  17. fi
  18. - name: set up tmate session for debugging
  19. if: env.USE_TMATE
  20. uses: mxschmitt/action-tmate@v3
  21. with:
  22. limit-access-to-actor: false
  23. detached: true