Closed dayananda30 closed 2 years ago
[…] but auto commit is failing even after I am specifying force push option.
I think using --force
as a push option will not help you here. The Action fails to create the commit, not to push the commit back to GitHub.
I think you've mixed up some options in your workflow.
The checkout step clones the repository to .
but the git-auto-commit-action
looks in ./manifest_files/azure/
for a Git repository.
Could it be that you meant to use file_pattern: ./manifest_files/azure/
in git-auto-commit-action
?
I assume your script changes files inside ./manifest_files/azure/
and you want to only commit those?
create_all_manifest_files_for_azure:
runs-on: [ self-hosted, linux ]
name: Create Files
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Create manifest files for azure
run: |
chmod +x ./create_files.sh
./create_files.sh "all"
- uses: stefanzweifel/git-auto-commit-action@v4
with:
- repository: ./manifest_files/azure/
+ file_pattern: ./manifest_files/azure/
commit_message: ${{ needs.create_variables_needed_in_jobs.outputs.auto-commit-message-prefix }}-Automated-Change
- push_options: --force
@stefanzweifel , I assume your script changes files inside ./manifest_files/azure/ and you want to only commit those? Yes, Your assumption is right. I want to include only files changed under ./manifest_files/azure/ directory. Let me change the lines as you suggested. Thank so much for prompt response.
closing this issue as changing repository to file_pattern attribute resolved my issue.
Yes, I set the branch value explicitly but still the issue persists.
Version of the Action v4.14.1
Describe the bug As part of the pipeline, I am checking out the code and running a script which does modifications to existing files in the repository. I am using auto-git-commit action to publish the changes to remote repository but auto commit is failing even after I am specifying force push option.
To Reproduce Steps to reproduce the behavior: Refer workflow
Expected behavior Changed files should be checked in to remote branch.
Screenshots
Used Workflow