<%- set prepare_workflow_if_check = "${{ fromJSON(needs.workflow-requirements.outputs.requirements-met) }}" %>
<%- set skip_test_coverage_check = "false" %>
<%- extends 'ci.yml.jinja' %>


<%- block name %>

name: <{ workflow_name }>
run-name: "<{ workflow_name }> (branch: ${{ github.ref_name }})"

<%- endblock name %>


<%- block on %>

on:
  schedule:
    # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onschedule
    - cron: '0 */8 * * *'  # Run every 8 hours

<%- endblock %>

<%- block concurrency %>

concurrency:
  group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: false

<%- endblock %>


<%- block permissions %>
<{- super() }>
<%- if workflow_slug == "scheduled" %>
  actions: write  # to trigger branch scheduled builds
<%- endif %>
<%- endblock permissions %>

<%- block pre_jobs %>

  <%- include "workflow-requirements-check.yml.jinja" %>
  <%- include "trigger-branch-workflows.yml.jinja" %>

<%- endblock pre_jobs %>
