diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5905eed40..34d0d7623 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,16 +73,10 @@ jobs: - name: consider debugging if: failure() - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} linux-build-all: runs-on: ubuntu-20.04 @@ -113,13 +107,7 @@ jobs: - name: consider debugging if: failure() - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} diff --git a/.github/workflows/canary-integration-test.yml b/.github/workflows/canary-integration-test.yml index 98df253d4..0a9cad8ba 100644 --- a/.github/workflows/canary-integration-test.yml +++ b/.github/workflows/canary-integration-test.yml @@ -204,16 +204,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} raw-disk: runs-on: ubuntu-20.04 @@ -264,16 +258,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} two-osds-in-device: runs-on: ubuntu-20.04 @@ -318,16 +306,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} osd-with-metadata-device: runs-on: ubuntu-20.04 @@ -378,16 +360,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} encryption: runs-on: ubuntu-20.04 @@ -483,16 +459,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} pvc: runs-on: ubuntu-20.04 @@ -563,16 +533,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} pvc-db: runs-on: ubuntu-20.04 @@ -619,16 +583,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} pvc-db-wal: runs-on: ubuntu-20.04 @@ -678,16 +636,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} encryption-pvc: runs-on: ubuntu-20.04 @@ -754,16 +706,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} encryption-pvc-db: runs-on: ubuntu-20.04 @@ -812,16 +758,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} encryption-pvc-db-wal: runs-on: ubuntu-20.04 @@ -871,16 +811,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} encryption-pvc-kms-vault-token-auth: runs-on: ubuntu-20.04 @@ -958,16 +892,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} encryption-pvc-kms-vault-k8s-auth: runs-on: ubuntu-20.04 @@ -1027,16 +955,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} lvm-pvc: runs-on: ubuntu-20.04 @@ -1088,16 +1010,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} multi-cluster-mirroring: runs-on: ubuntu-20.04 @@ -1345,16 +1261,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} rgw-multisite-testing: runs-on: ubuntu-20.04 @@ -1380,16 +1290,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} encryption-pvc-kms-ibm-kp: runs-on: ubuntu-20.04 @@ -1418,16 +1322,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} multus-cluster-network: runs-on: ubuntu-20.04 @@ -1506,16 +1404,10 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} csi-hostnetwork-disabled: runs-on: ubuntu-20.04 @@ -1565,13 +1457,7 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} diff --git a/.github/workflows/integration-test-helm-suite.yaml b/.github/workflows/integration-test-helm-suite.yaml index 4e79a8a6b..79be133e3 100644 --- a/.github/workflows/integration-test-helm-suite.yaml +++ b/.github/workflows/integration-test-helm-suite.yaml @@ -63,13 +63,7 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} diff --git a/.github/workflows/integration-test-mgr-suite.yaml b/.github/workflows/integration-test-mgr-suite.yaml index eb9170c58..4ebbe0547 100644 --- a/.github/workflows/integration-test-mgr-suite.yaml +++ b/.github/workflows/integration-test-mgr-suite.yaml @@ -57,13 +57,7 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} diff --git a/.github/workflows/integration-test-multi-cluster-suite.yaml b/.github/workflows/integration-test-multi-cluster-suite.yaml index 13838c0a8..fd52c2f50 100644 --- a/.github/workflows/integration-test-multi-cluster-suite.yaml +++ b/.github/workflows/integration-test-multi-cluster-suite.yaml @@ -59,13 +59,7 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} diff --git a/.github/workflows/integration-test-object-suite.yaml b/.github/workflows/integration-test-object-suite.yaml index 74df6da03..474a87457 100644 --- a/.github/workflows/integration-test-object-suite.yaml +++ b/.github/workflows/integration-test-object-suite.yaml @@ -58,13 +58,7 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} diff --git a/.github/workflows/integration-test-smoke-suite.yaml b/.github/workflows/integration-test-smoke-suite.yaml index f09f241c1..0570bfc32 100644 --- a/.github/workflows/integration-test-smoke-suite.yaml +++ b/.github/workflows/integration-test-smoke-suite.yaml @@ -58,13 +58,7 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} diff --git a/.github/workflows/integration-test-upgrade-suite.yaml b/.github/workflows/integration-test-upgrade-suite.yaml index f93ec30ab..275cb266a 100644 --- a/.github/workflows/integration-test-upgrade-suite.yaml +++ b/.github/workflows/integration-test-upgrade-suite.yaml @@ -106,13 +106,7 @@ jobs: - name: consider debugging if: failure() && github.event_name == 'pull_request' - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} diff --git a/.github/workflows/push-build.yaml b/.github/workflows/push-build.yaml index cddb8bdb6..9d0388977 100644 --- a/.github/workflows/push-build.yaml +++ b/.github/workflows/push-build.yaml @@ -78,13 +78,7 @@ jobs: - name: consider debugging if: failure() - 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 "${{ secrets.USE_TMATE }}" ] || [ "$GITHUB_RUN_ATTEMPT" -gt 1 ]; then - echo USE_TMATE=1 >> $GITHUB_ENV - fi - - - name: set up tmate session for debugging - if: failure() && env.USE_TMATE - uses: mxschmitt/action-tmate@v3 timeout-minutes: 60 + uses: ./.github/workflows/tmate_debug + with: + use-tmate: ${{ secrets.USE_TMATE }} diff --git a/.github/workflows/tmate_debug/action.yml b/.github/workflows/tmate_debug/action.yml new file mode 100644 index 000000000..47fef44ea --- /dev/null +++ b/.github/workflows/tmate_debug/action.yml @@ -0,0 +1,20 @@ +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} + 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