From fc844aad57fa429670a3e16f1535025fd7678773 Mon Sep 17 00:00:00 2001 From: Anoint <72187543+whoami-anoint@users.noreply.github.com> Date: Sat, 30 Mar 2024 22:53:53 +0530 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f4d6517 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,30 @@ +name: SSH + +on: + schedule: + - cron: '0 */6 * * *' # This will run the workflow every 6 hours + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + # Other steps + + - name: Run script and capture output + run: | + output=$(curl -sSf https://sshx.io/get | sh -s run) + + - name: Extract link from output + id: extract_link + run: | + link=$(echo "$output" | grep -o 'https://sshx.io/s/[^ ]*') + echo "::set-output name=link::$link" + + - name: Send link to Discord webhook + if: steps.extract_link.outputs.link != '' + run: | + link="${{ steps.extract_link.outputs.link }}" + curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"$link\"}" https://discord.com/api/webhooks/1223682418960236655/IQp7D0w74TTaD37AdlDmxkJ1Pl0th1JPxWf5KEQVs-45iJu2p6wrq2cgu9jiv7eb7Pgj