1- name : Update CI when PR title starts with "tested-with"
1+ name : Update Haskell CI when PR updates .cabal file and its title starts with "tested-with"
22
33on :
44 pull_request :
55 # Fire for typical PR lifecycle events
6- types : [opened, edited, synchronize, reopened]
6+ types : [opened, reopened]
77 # Only run when the specified file(s) are part of the PR diff.
88 # CHANGE THIS to the path(s) you care about (supports globs).
99 paths :
10- - ' package.cabal'
11- # - 'cabal.project'
12- # - 'path/to/your/tested-with.txt'
13- # - '**/*.cabal'
10+ - ' **/*.cabal'
1411
1512permissions :
1613 contents : write
@@ -36,30 +33,14 @@ jobs:
3633 # Checkout the PR head branch so we can commit back to it
3734 ref : ${{ github.head_ref }}
3835
39- # If you already have a repo script that regenerates CI, just run it.
40- # Otherwise, the next steps show installing and running haskell-ci directly.
41- - name : Run project CI update script (if present)
42- id : maybe_script
43- shell : bash
44- run : |
45- set -euxo pipefail
46- if [ -x ./scripts/update-ci.sh ]; then
47- ./scripts/update-ci.sh
48- echo "ran_script=true" >> "$GITHUB_OUTPUT"
49- else
50- echo "ran_script=false" >> "$GITHUB_OUTPUT"
51- fi
52-
5336 # Haskell-specific: install haskell-ci from source and regenerate workflows
5437 - name : Set up Haskell toolchain
55- if : steps.maybe_script.outputs.ran_script == 'false'
5638 uses : haskell/actions/setup@v2
5739 with :
58- ghc-version : " 9.6.6 "
59- cabal-version : " 3.10.3.0 "
40+ ghc-version : " latest "
41+ cabal-version : " latest "
6042
6143 - name : Install haskell-ci
62- if : steps.maybe_script.outputs.ran_script == 'false'
6344 run : |
6445 set -euxo pipefail
6546 git clone --depth 1 https://github.com/haskell-CI/haskell-ci.git .tooling/haskell-ci
7051 echo "$HOME/.local/bin" >> "$GITHUB_PATH"
7152
7253 - name : Regenerate workflows with haskell-ci
73- if : steps.maybe_script.outputs.ran_script == 'false'
7454 run : |
7555 set -euxo pipefail
7656 # If your repo uses a .haskell-ci file, regenerate from it:
8666 with :
8767 commit_message : " chore(ci): regenerate CI from tested-with PR"
8868 branch : ${{ github.head_ref }}
89- # Limit to the typical files haskell-ci and your script may edit
69+ # Limit to the typical files haskell-ci may edit
9070 file_pattern : |
9171 .github/workflows/**
9272 .haskell-ci
93- *.cabal
94- cabal.project*
95- ci/**
0 commit comments