From 732adf32a8616902e2b866ddabea73a54d39898e Mon Sep 17 00:00:00 2001 From: lukqw Date: Tue, 3 Dec 2024 13:30:23 +0100 Subject: [PATCH] tmp test ephemeral shell script --- .github/workflows/ephemeral.yml | 37 ++------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ephemeral.yml b/.github/workflows/ephemeral.yml index 1c52304..600695e 100644 --- a/.github/workflows/ephemeral.yml +++ b/.github/workflows/ephemeral.yml @@ -4,6 +4,8 @@ on: schedule: - cron: '0 * * * *' workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened] permissions: contents: write @@ -55,38 +57,3 @@ jobs: echo "NEW_URL=$NEW_URL" >> $GITHUB_ENV env: LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }} - - - name: Generate index.html with New Redirect URL - run: | - NEW_URL="${{ env.NEW_URL }}" - - # Validate the URL - if [[ ! "$NEW_URL" =~ ^https?:// ]]; then - echo "Error: Invalid URL provided." - exit 1 - fi - - echo "Redirecting to: $NEW_URL" - - cat > index.html < - - - - - Redirecting... - - -

If you are not redirected automatically, follow this link.

- - - EOL - - - name: Switch to gh-pages Branch and Commit Changes - run: | - git fetch origin gh-pages || echo "gh-pages branch does not exist; creating it." - git checkout gh-pages || git checkout --orphan gh-pages - git rm -rf . # Remove all files in the branch - git add index.html - git commit -m "Update redirect to ${NEW_URL}" - git push origin gh-pages --force