file pattern not supporting deletion #359
Replies: 2 comments 1 reply
-
Hi there Could you please share your exact workflow script? How does your You could try the following, but the step will fail if - name: Auto commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: data/*/azure.yaml
commit_options: '--all' # Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected. So you might have to fall back to use - name: Auto commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: data/
commit_options: '--all' Or could you explain what you want to accomplish? |
Beta Was this translation helpful? Give feedback.
-
Yeah sure, - name: Run script
working-directory: ./scripts
run: python azure.py
- name: Update PR Contents
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 #v5.1.0
if: ${{ github.event_name == 'pull_request' }}
with:
commit_message: "chore(data): data changes."
branch: ${{ github.head_ref }}
file_pattern: "data/*/azure.yaml" The current implementation of the Problem Source:In the current script, the file patterns are expanded in the following part of the code: https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh#L86 Suggested ImprovementTo address this, the input file pattern could be handled differently. Rather than expanding the pattern after file deletion, the pattern could be provided as a list but still be kept in its original pattern format in the git status command. This would allow deleted files to be picked up and committed as well. Yes I could switch to the following example but it will pick up all files, I want the delete to be picked up only for the azure.yaml file. - name: Auto commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: data/
commit_options: "--all" |
Beta Was this translation helpful? Give feedback.
-
I'm having issues with GitHub's auto-commit action when using the file pattern file_pattern: data//azure.yaml. When the azure.yaml file is deleted, it doesn't seem to be picked up in the auto commit. However, if I change the pattern to file_pattern: data/, it works. How can I modify the pattern to ensure it tracks deletions for the specific azure.yaml file without changing the structure and mentioning the file name as I want to only track that for now.
Beta Was this translation helpful? Give feedback.
All reactions