Skip to content

Commit

Permalink
feat(rebase): add remote input
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Nov 10, 2022
1 parent 81d89ea commit fbfa896
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,13 @@ Rebase two branches and push.

##### Inputs

| required | name | description | Example | Default |
|----------|----------|--------------------------------------|--------------------------------|---------|
| Yes | `target` | Target branch you wish to update. | `develop` ||
| Yes | `base` | Base branch to use to rebase target. | `main` ||
| Yes | `token` | GitHub token to use. | `${{ secrets.GH_REPO_TOKEN }}` ||
| No | `force` | Force push. | `true` | `false` |
| required | name | description | Example | Default |
|----------|----------|--------------------------------------|--------------------------------|----------|
| Yes | `target` | Target branch you wish to update. | `develop` ||
| Yes | `base` | Base branch to use to rebase target. | `main` ||
| Yes | `token` | GitHub token to use. | `${{ secrets.GH_REPO_TOKEN }}` ||
| No | `force` | Force push. | `true` | `false` |
| No | `remote` | The remote to use | `upstream` | `origin` |

##### Example

Expand All @@ -391,6 +392,7 @@ Rebase two branches and push.
base: main
target: develop
force: true
remote: upstream
```

#### update-tags
Expand Down
7 changes: 6 additions & 1 deletion rebase/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ inputs:
required: false
default: 'false'

remote:
description: 'The remote to use'
required: false
default: 'origin'

runs:
using: composite
steps:
Expand All @@ -36,7 +41,7 @@ runs:
id: rebase
shell: bash
run: |
git rebase "origin/${{ inputs.base }}" || (echo "fail=true" >> $GITHUB_OUTPUT && git rebase --abort)
git rebase "${{ inputs.remote }}/${{ inputs.base }}" || (echo "fail=true" >> $GITHUB_OUTPUT && git rebase --abort)
- name: 'Push'
shell: bash
Expand Down

0 comments on commit fbfa896

Please sign in to comment.