Skip to content

Commit

Permalink
enh(ci): trigger scheduled builds on maintenance branches weekly
Browse files Browse the repository at this point in the history
  • Loading branch information
mushroomempires committed Nov 12, 2024
1 parent 828d374 commit 6d14c50
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/centreon-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,24 @@ on:

jobs:
dispatch-to-maintained-branches:
if: ${{ github.event_name == 'schedule' && github.ref_name == 'develop' }}
if: ${{ github.run_attempt == 1 && github.event_name == 'schedule' && github.ref_name == 'develop' }}
runs-on: ubuntu-24.04
steps:
- name: Checkout sources
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- run: |
gh workflow run robot-nightly.yml -r "dev-24.04.x"
gh workflow run robot-nightly.yml -r "dev-23.10.x"
gh workflow run robot-nightly.yml -r "dev-23.04.x"
gh workflow run robot-nightly.yml -r "dev-22.10.x"
- name: Check current day of the week
id: day_check
run: echo "day_of_week=$(date +%u)" >> $GITHUB_OUTPUT
shell: bash

- if: ${{ steps.day_check.outputs.day_of_week == '1' }}
run: |
NIGHTLY_TARGETS=("dev-22.10.x" "dev-23.04.x" "dev-23.10.x" "dev-24.04.x" "dev-24.10.x")
for target in "${NIGHTLY_TARGETS[@]}"; do
echo "[INFO] - Dispatching nightly run to $target branch."
gh workflow run centreon-collect.yml -r "$target" -f is_nightly=true
done
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 6d14c50

Please sign in to comment.