Files
my_nvim_config/.github/workflows/trigger_rebuild.yaml

37 lines
1.0 KiB
YAML

name: Trigger Container Rebuild
on:
push:
branches:
- main
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Trigger rebuild
env:
GH_TOKEN: ${{ secrets.PUBLIC_REPO_SYNC_TOKEN }}
run: |
if [ -z "$GH_TOKEN" ]; then
echo "Error: PUBLIC_REPO_SYNC_TOKEN secret is not set"
exit 1
fi
response=$(curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-w "%{http_code}" \
-o /dev/null \
https://api.github.com/repos/Cian-H/my_nvim/dispatches \
-d '{"event_type":"rebuild-container","client_payload":{"repository":"${{ github.repository }}"}}')
if [ "$response" -ne 204 ]; then
echo "Failed to trigger workflow. HTTP status code: $response"
exit 1
fi
echo "Successfully triggered workflow"