exclude files from commit #402
-
|
Hi, I'd like to exclude .yarnrc.yml from the auto commit, because it complains about a security issue. in a terminal, I'm trying to set different values to Can you please help? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hi there Without seeing your workflow code, I assume your job is very basic and looks similar to this: - uses: stefanzweifel/git-auto-commit-action@v7
with:
file_pattern: ":!.yarnrc.yml"I think there's a high chance the translation from YAML to the workflow run is the problem here. My suggestion would be to skip If you would like to still use git-auto-commit, a few solutions come to mind (not tested): Manually stage files, skip dirty checks and use - name: Stage files except .yarnrc.yml
run: |
git add .
git reset -- .yarnrc.yml
- uses: stefanzweifel/git-auto-commit-action@v7
with:
skip_dirty_check: true
add_options: '--no-all'Or run your git-add command before git-auto-commit and skip dirty checks again. - name: Add files with exclusion
run: |
# This properly handles the exclusion syntax
git add . ':!.yarnrc.yml'
- uses: stefanzweifel/git-auto-commit-action@v7
with:
skip_dirty_check: true
add_options: '--no-all'Also to note: |
Beta Was this translation helpful? Give feedback.
-
|
Yeah, sorry, I just updated the question with all the details. I debugged into the code locally and figured it out that although I was running the autocommit from a subdir, I tried to exclude the file relatively from there by I figured out that if I set the absolute |
Beta Was this translation helpful? Give feedback.
Yeah, sorry, I just updated the question with all the details.
I debugged into the code locally and figured it out that although I was running the autocommit from a subdir, I tried to exclude the file relatively from there by
add_options: ':!.yarnrc.yml'.I figured out that if I set the absolute
add_options: ':!frontend/.yarnrc.yml', it works fine. Thank you all.