Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
push-branch: 'master'
commit-message: 'publish'
force-add: 'true'
files: a.txt b.txt c.txt dirA/ dirB/ dirC/a.txt
```

If you use `commit` inside [matrix](https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix), set variable `rebase='true'` for pulling and rebasing changes.
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ inputs:
description: 'Pull and rebase before commiting. Useful when using commit inside matrix.'
requried: false
default: 'false'
files:
description: 'Specific files to add.'
requried: false
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
3 changes: 3 additions & 0 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def run():
force_add = local.env.get('INPUT_FORCE-ADD')
branch = local.env.get('INPUT_PUSH-BRANCH') or local.env.get('GITHUB_REF').split('/')[2]
rebase = local.env.get('INPUT_REBASE', 'false')
files = local.env.get('INPUT_FILES', '')
with open(netrc_path, 'w') as f:
f.write(
f'machine github.com\n'
Expand All @@ -36,6 +37,8 @@ def run():
if force_add == 'true':
add_args.append('-f')
add_args.append('-A')
if files:
add_args.append(files)
if rebase == 'true':
debug(git(['pull', '--rebase', '--autostash', 'origin', branch]))
debug(git(['checkout', '-b', branch]))
Expand Down