Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/build_loop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: 4. Build Loop
name: Triggered Loop Build
run-name: Build Loop (${{ github.ref_name }})
on:
workflow_dispatch:
schedule:
# Check for updates every Sunday
# Later logic builds if there are updates or if it is the 2nd Sunday of the month
- cron: "33 7 * * 0" # Sunday at UTC 7:33
inputs:
is_scheduled:
description: 'Whether this was dispatched from the trigger scheduled workflow'
required: false
type: boolean
default: false

env:
GH_PAT: ${{ secrets.GH_PAT }}
Expand Down Expand Up @@ -157,7 +159,7 @@ jobs:
uses: ./.github/workflows/create_certs.yml
secrets: inherit
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.is_scheduled != 'true') ||
(vars.SCHEDULED_BUILD != 'false' && needs.check_status.outputs.IS_SECOND_IN_MONTH == 'true') ||
(vars.SCHEDULED_SYNC != 'false' && needs.check_status.outputs.NEW_COMMITS == 'true' )

Expand All @@ -170,7 +172,7 @@ jobs:
contents: write
if:
| # builds with manual start; if scheduled: once a month or when new commits are found
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.is_scheduled != 'true') ||
(vars.SCHEDULED_BUILD != 'false' && needs.check_status.outputs.IS_SECOND_IN_MONTH == 'true') ||
(vars.SCHEDULED_SYNC != 'false' && needs.check_status.outputs.NEW_COMMITS == 'true' )
steps:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/trigger_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 4. Build Loop
run-name: Trigger Build Loop (${{ github.ref_name }})
on:
workflow_dispatch:
schedule:
- cron: "33 7 * * 0" # Sunday at UTC 7:33

jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Trigger target workflow
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
curl --fail -X PUT \
-H "Authorization: Bearer ${GH_PAT}" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/build_loop.yml/enable

curl --fail -X POST \
-H "Authorization: Bearer ${GH_PAT}" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/build_loop.yml/dispatches \
-d '{"ref":"${{ github.ref_name }}", "inputs": {"is_scheduled": "true"}}'