stefanzweifel / git-auto-commit-action

Automatically commit and push changed files back to GitHub with this GitHub Action for the 80% use case.
MIT License
1.96k stars 226 forks source link

Add tagging only on a specific branch #207

Closed nosisky closed 2 years ago

nosisky commented 2 years ago

I would like to skip tagging for a specific branch, I don't know If there is an existing implementation for that. At the moment I have:

        - uses: stefanzweifel/git-auto-commit-action@v4
          with:
            commit_message:  commit message
            tagging_message:  module version
            commit_user_name: Developer
            commit_user_email: developer@dev.com

I would want something like:

          - uses: stefanzweifel/git-auto-commit-action@v4
          with:
            commit_message:  commit message
            if branch === master
            tagging_message:  module version
            commit_user_name: Developer
            commit_user_email: developer@dev.com
stefanzweifel commented 2 years ago

This can be achieved in a couple of ways:

In your example, it would look like this:

       - uses: stefanzweifel/git-auto-commit-action@v4
       if: contains(github.ref, "master")
       with:
         commit_message:  commit message

         tagging_message:  module version
         commit_user_name: Developer
         commit_user_email: developer@dev.com