Remove build from mirror #224
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Remove build from mirror | |
on: | |
workflow_dispatch: | |
inputs: | |
device: | |
description: Device to remove build for | |
date: | |
description: Date of build to remove | |
jobs: | |
remove: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup SSH Keys and known_hosts | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
mkdir -p ~/.ssh | |
ssh-keyscan mirror.lineageos.org >> ~/.ssh/known_hosts | |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
ssh-add - <<< "${{ secrets.MIRROR_SSH }}" | |
- name: Remove Build | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
ssh [email protected] bash /usr/local/bin/rmbuild ${{github.event.inputs.device}} ${{github.event.inputs.date}} | |
- name: notify slack | |
if: success() | |
run: | | |
curl -XPOST ${{ secrets.DISCORD_RELEASES_WEBHOOK }} -d '{"username": "Github Actions", "text": "${{github.event.inputs.device}}/${{github.event.inputs.date}} was removed from the mirror"}' | |
- name: notify slack | |
if: failure() | |
run: | | |
curl -XPOST ${{ secrets.DISCORD_RELEASES_WEBHOOK }} -d '{"username": "Github Actions", "text": "${{github.event.inputs.device}}/${{github.event.inputs.date}} was not removed from the mirror, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} for more information"}' |