haskell-CI / haskell-ci

Scripts and instructions for using CI services (e.g. Travis CI or Appveyor) with multiple GHC configurations
GNU General Public License v3.0
438 stars 71 forks source link

"generated by a script via" missing command name if REGENDATA also lacks it #451

Open RyanGlScott opened 3 years ago

RyanGlScott commented 3 years ago

A minor bug: if a generated YAML file's REGENDATA is missing the name of the command (e.g., github), then the "this config has been generated by a script via" message will also be missing it, resulting in an invalid command. Here is an example from profunctors' YAML:

# This GitHub workflow config has been generated by a script via
#
#   haskell-ci '--config=cabal.haskell-ci' 'cabal.project'
#
# To regenerate the script (for example after adjusting tested-with) run
#
#   haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.11.20201221
#
# REGENDATA ("0.11.20201221",["--config=cabal.haskell-ci","cabal.project"])

Notice the use of haskell-ci '--config=cabal.haskell-ci' 'cabal.project', which should actually be haskell-ci 'github' '--config=cabal.haskell-ci' 'cabal.project'.

RyanGlScott commented 3 years ago

You can also include mismatched command names in the REGENDATA, and haskell-ci will silently ignore them. For instance, if you put the following REGENDATA in .github/workflows/haskell-ci.yml:

# REGENDATA ("0.11.20201227",["travis","--config=cabal.haskell-ci","cabal.project"])

Then it will still generate GitHub Actions YAML, but the recommended command will be haskell-ci 'travis' '--config=cabal.haskell-ci' 'cabal.project' nonetheless.