Skip to content

Commit 38a5f0d

Browse files
committed
[forge] Run forge nightly on weekdays
1 parent fed1684 commit 38a5f0d

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

.github/workflows/forge-stable.yaml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ on:
4949
description: The number of test jobs to run in parallel. If not specified, defaults to 1
5050
default: 1
5151

52-
# NOTE: to support testing different branches on different schedules, you need to specify the cron schedule in the 'determine-test-branch' step as well below
53-
# Reference: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
5452
schedule:
55-
- cron: "0 22 * * 0,2,4" # The main branch cadence. This runs every Sun,Tues,Thurs
53+
- cron: "0 22 * * 1-5" # The main branch cadence. This runs every Mon-Fri
5654
pull_request:
5755
paths:
5856
- ".github/workflows/forge-stable.yaml"
@@ -147,24 +145,19 @@ jobs:
147145
id: determine-test-branch
148146
# NOTE: the schedule cron MUST match the one in the 'on.schedule.cron' section above
149147
run: |
148+
BRANCH=""
150149
if [[ "${{ github.event_name }}" == "schedule" ]]; then
151-
if [[ "${{ github.event.schedule }}" == "0 22 * * 0,2,4" ]]; then
152-
echo "Branch: main"
153-
echo "BRANCH=main" >> $GITHUB_OUTPUT
154-
else
155-
echo "Unknown schedule: ${{ github.event.schedule }}"
156-
exit 1
157-
fi
150+
echo "BRANCH=main" >> $GITHUB_OUTPUT
158151
elif [[ "${{ github.event_name }}" == "push" ]]; then
159-
echo "Branch: ${{ github.ref_name }}"
160-
echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
152+
echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
161153
# on workflow_dispatch, this will simply use the inputs.GIT_SHA given (or the default)
162154
elif [[ -n "${{ inputs.GIT_SHA }}" ]]; then
163155
echo "BRANCH=${{ inputs.GIT_SHA }}" >> $GITHUB_OUTPUT
164156
# if GIT_SHA not provided, use the branch where workflow runs on
165157
else
166158
echo "BRANCH=${{ github.head_ref }}" >> $GITHUB_OUTPUT
167159
fi
160+
echo "Branch: $(grep BRANCH= $GITHUB_OUTPUT)"
168161
# Use the branch hash instead of the full branch name to stay under kubernetes namespace length limit
169162
- name: Hash the branch
170163
id: hash-branch

0 commit comments

Comments
 (0)