Skip to content

Commit 94f133b

Browse files
Workflow dispatch with the same behaviour as nightly job
1 parent a29d2f1 commit 94f133b

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ on:
1111
- 'master'
1212
schedule:
1313
- cron: 0 0 * * *
14+
workflow_dispatch:
15+
inputs:
16+
nightly:
17+
description: Run with the same settings as a nightly build
18+
type: boolean
19+
default: false
1420

1521
concurrency:
1622
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -29,9 +35,12 @@ jobs:
2935
runs-on: ${{ matrix.os }}
3036

3137
steps:
32-
- name: Set NIGHTLY environment variable if scheduled
33-
if: github.event_name == 'schedule'
34-
run: echo "NIGHTLY=1" >> $GITHUB_ENV
38+
- name: Set NIGHTLY environment variable if the job was triggered by the scheduler
39+
if: "${{ github.event_name == 'schedule'
40+
|| github.event_name == 'workflow_dispatch' && github.event.inputs.nightly }}"
41+
run: |
42+
echo "NIGHTLY=true" >> $GITHUB_ENV
43+
3544
- uses: actions/checkout@v4
3645
- uses: haskell-actions/setup@v2
3746
with:
@@ -53,9 +62,12 @@ jobs:
5362
name: Stack
5463
runs-on: ubuntu-latest
5564
steps:
56-
- name: Set NIGHTLY environment variable if scheduled
57-
if: github.event_name == 'schedule'
58-
run: echo "NIGHTLY=1" >> $GITHUB_ENV
65+
- name: Set NIGHTLY environment variable if the job was triggered by the scheduler
66+
if: "${{ github.event_name == 'schedule'
67+
|| github.event_name == 'workflow_dispatch' && github.event.inputs.nightly }}"
68+
run: |
69+
echo "NIGHTLY=true" >> $GITHUB_ENV
70+
5971
- uses: actions/checkout@v4
6072

6173
- uses: haskell-actions/setup@v2

0 commit comments

Comments
 (0)