fortrabbit / craft-copy

Deployment tools for Craft on fortrabbit
https://www.fortrabbit.com
MIT License
73 stars 8 forks source link

interactive=0 auto commits with `init Craft` #158

Closed Maybach91 closed 1 year ago

Maybach91 commented 1 year ago

Case: Uncomitted changes in the project and running code/up with the following config:

config.yaml


before:
    # Before deploying code by Git, please:
    code/up:
        # 1. Run your NPM production build
        - "cd buildchain && npm run build"
        # 2. Sync the results of the build up
        - "php craft copy/folder/up production web/dist -i=0"

This (-i=0) leads to a commit made by craft-copy which says init Craft. Doing this multiple times is confusing for the commit history.

Maybe a config setting to overwrite the default commit message or something like more according to the action which triggered, like chore: code/up or more explaining. But init Craft is confusing in this case.

ostark commented 1 year ago

I can't imagine -i=0 with copy/folder/up is causing the problem. I am actually surprised CodeUpAction uses the default message.

If you rsync the web/dist folder anyway (copy/folder/up), you should exclude the generated files from git:

#.gitignore
/web/dist
pheeque1 commented 1 year ago

Hi @Maybach91 ,

We have just published a new release of Craft Copy that allows you to customise the commit message for instance in a Github action. Please see how to use it here.

Thank you for bringing it to our attention!