Commit if there are file by pattern in the commit itself #176
-
Is your feature request related to a problem? Please describe. Our idea was to check if the commit include files of a pattern/folder included in this way the action can be execute to push the changes. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
The I think examples make everything easier. # other code related to when workflow is triggered
- run: /execute/some/code
- uses: stefanzweifel/git-auto-commit-action@v4
id: auto-commit-action
with:
file_pattern: src/*.js
- name: "Generate PDFs if previously a commit has been created"
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: /generate/pdfs
- name: "Commit generated PDFs"
if: steps.auto-commit-action.outputs.changes_detected == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: src/*.pdf
commit_message: "Add auto generated PDFs" If not, could you please share more information of what you want to achieve here? |
Beta Was this translation helpful? Give feedback.
-
Seems perfect, I wasn't sure if I can mention twice the action as the examples mention only once. |
Beta Was this translation helpful? Give feedback.
-
You could even use the Action trice or 16 times in a workflow. :)
Thats a question you have to answer for yourself as it depends on what you want to achieve in your workflow. I close this issue now, as I think your primary question has been answered. Feel free to create a new discussion thread, if you have another question. |
Beta Was this translation helpful? Give feedback.
The
file_pattern
is used in the "is dirty"-check and determines if files should be added and committed (see code); so I think what you want to do should work.I think examples make everything easier.
If I understood you correctly, your workflow looks something like this: