Files
whisper-frontend/.gitea/workflows/cleanup-branch.yaml
Andreas Svanberg 6a845b8c21
All checks were successful
Deploy to branch.dsv.su.se / Deploy-branch (pull_request) Successful in 58s
Clean up branch.dsv.su.se / Cleanup-branch (pull_request) Successful in 6s
Mangle branch name in action
2024-07-08 14:16:01 +02:00

20 lines
748 B
YAML

name: Clean up branch.dsv.su.se
on:
pull_request:
types:
- closed
jobs:
Cleanup-branch:
runs-on: ubuntu-latest
steps:
- name: Generate mangled vhost name
id: mangled-name
run: |
MANGLED_BRANCH_NAME="$(echo ${{ gitea.headref}} | sed -r -e 's%/%-%g' -e 's/[^0-9a-z\-]//g')"
echo $MANGLED_BRANCH_NAME
echo "MANGLED_NAME=$MANGLED_BRANCH_NAME" >> "$GITHUB_OUTPUT"
- run: |
echo "${{ secrets.BRANCH_CLEANUP_KEY }}" >> ssh_key
chmod 0600 ssh_key
- run: echo "${{ gitea.serverurl }}/${{ gitea.repository }}.git ${{ gitea.headref }} ${{ steps.mangled-name.outputs.MANGLED_NAME }}" | ssh -o StrictHostKeyChecking=accept-new -i ssh_key branch.dsv.su.se