summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/schedule.yaml
blob: f8330651c24da3ab679cc0226e5abf47a457db14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
name: Schedule Trigger

on:
  schedule:
    - cron: '0 6 * * *'
  workflow_dispatch:

jobs:
  Release-Nightly:
    runs-on: ubuntu-latest
    env:
      GIT_BRANCH: "development"
      WORKFLOW_TO_TRIGGER: "release_beta_to_dev.yaml"
    steps:
      - name: Execute
        run: |
          echo "**** Trigging ${{ env.WORKFLOW_TO_TRIGGER }} of branch ${{ env.GIT_BRANCH }} ****"
          if curl -sfX GET https://raw.githubusercontent.com/${{ github.repository }}/${{ env.GIT_BRANCH }}/.github/workflows/${{ env.WORKFLOW_TO_TRIGGER }} > /dev/null 2>&1; then
            echo "**** Workflow exists. Triggering workflow for branch ${{ env.GIT_BRANCH }} ****"
            curl -ifX POST \
                -H "Authorization: token ${{ secrets.WF_GITHUB_TOKEN }}" \
                -H "Accept: application/vnd.github.v3+json" \
                -d "{\"ref\":\"refs/heads/${{ env.GIT_BRANCH }}\"}" \
                https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ env.WORKFLOW_TO_TRIGGER }}/dispatches
          else
            echo "**** Workflow doesn't exist! Skipping... ****"
          fi