Update trigger_rebuild.yaml

This commit is contained in:
2025-01-22 15:45:20 +00:00
committed by GitHub
parent 23b66d5837
commit 998f249adb

View File

@@ -1,34 +1,34 @@
name: Trigger Build
name: Trigger Container Rebuild
on:
push:
branches:
- main # or whichever branches you want to monitor
- main
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Trigger container rebuild
- name: Trigger rebuild
env:
GH_TOKEN: ${{ secrets.PUBLIC_REPO_SYNC_TOKEN }}
run: |
curl -L \
-X GET \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/Cian-H/my_nvim
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 ${{ secrets.PUBLIC_REPO_SYNC_TOKEN }}" \
-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 200 ]; then
if [ "$response" -ne 204 ]; then
echo "Failed to trigger workflow. HTTP status code: $response"
exit 1
fi