Files
my_nvim_config/.github/workflows/trigger_rebuild.yaml

30 lines
899 B
YAML

name: Trigger Build
on:
push:
branches:
- main # or whichever branches you want to monitor
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Trigger container rebuild
run: |
response=$(curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-w "%{http_code}" \
-o /dev/null \
https://api.github.com/repos/OWNER/REPO/dispatches \
-d '{"event_type":"rebuild-container","client_payload":{"repository":"${{ github.repository }}"}}')
if [ "$response" -ne 200 ]; then
echo "Failed to trigger workflow. HTTP status code: $response"
exit 1
fi
echo "Successfully triggered workflow"