From 70d8d3f4a057906f744342d1332401afcf30596f Mon Sep 17 00:00:00 2001 From: Soubinan Date: Sat, 23 Mar 2024 04:19:55 -0400 Subject: [PATCH] Add auto-cleaner "test" step --- .github/workflows/auto-cleaner.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/auto-cleaner.yml b/.github/workflows/auto-cleaner.yml index bc156e8..021d6b4 100644 --- a/.github/workflows/auto-cleaner.yml +++ b/.github/workflows/auto-cleaner.yml @@ -37,6 +37,7 @@ jobs: node-version: ${{env.NODE_VERSION}} - name: Cleanup + if: github.event.action == 'closed' && github.event.pull_request.merged run: | cat << EOF > /tmp/rclone.conf $RCLONE_CONFIG @@ -49,3 +50,18 @@ jobs: RCLONE_CONFIG: ${{secrets.RCLONE_CONFIG}} RCLONE_CONFIG_PASS: ${{secrets.RCLONE_CONFIG_PASS}} MAX_BUILDS: 1 + + - name: Cleanup Test + if: github.event.action != 'closed' + run: | + cat << EOF > /tmp/rclone.conf + $RCLONE_CONFIG + EOF + echo + node ${{github.workspace}}/.github/auto-cleaner.js + env: + API_TOKEN: ${{secrets.HOMELAB_LXC_TOKEN}} + API_ENDPOINT: ${{secrets.HOMELAB_LXC_EP}} + RCLONE_CONFIG: ${{secrets.RCLONE_CONFIG}} + RCLONE_CONFIG_PASS: ${{secrets.RCLONE_CONFIG_PASS}} + MAX_BUILDS: 10