Skip to content

Series and events permissions override enhancement #37

Series and events permissions override enhancement

Series and events permissions override enhancement #37

name: PRs » Remove Pull Request Page
on:
pull_request_target:
types:
- closed
concurrency:
group: pull-request-page
cancel-in-progress: false
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
jobs:
delete-pr-directory:
runs-on: ubuntu-latest
steps:
- name: Prepare git
run: |
git config --global user.name "Admin Interface Deployment Bot"
git config --global user.email "cloud@opencast.org"
- name: Prepare GitHub SSH key from org level secret
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY_TEST }}
run: |
install -dm 700 ~/.ssh/
echo "${DEPLOY_KEY}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Clone test repository
run: |
git clone -b gh-pages "git@github.com:opencast/opencast-admin-interface-test.git" admin-interface-test
- name: Delete build if present
working-directory: admin-interface-test
run: |
if [ -d "${PR_NUMBER}" ]; then
rm -rf "${PR_NUMBER}"
echo "Directory ${PR_NUMBER} deleted successfully."
else
echo "Directory ${PR_NUMBER} does not exist. Skipping deletion."
fi
- name: Clean index.html
working-directory: admin-interface-test
run: |
echo '<html><body><ul>' > index.html
find . -maxdepth 2 -name '*_*' -type d \
| sort -r \
| sed 's/^\(.*\)$/<li><a href=\1>\1<\/a><\/li>/' >> index.html
echo '</ul></body></html>' >> index.html
- name: Commit new version
working-directory: admin-interface-test
run: |
git add .
# Commit and push, or just say true since the commit fails if nothing has changed
(git commit -m "Remove deployment ${PR_NUMBER} due to PR closure" && git push origin gh-pages --force) || true