Skip to content

Commit

Permalink
feat: add rebase action
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed May 18, 2022
1 parent ca59225 commit a653be5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,24 @@ Set up git credentials and authenticate as MyParcelBot.
token: ${{ secrets.GITHUB_TOKEN }}
```

### rebase

[Source](rebase/action.yml)

Rebase two branches and push.

- Needs a [GitHub] token in `token`.

#### Example

```yaml
- uses: myparcelnl/actions/rebase@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: main
target: develop
```

[Codecov]: https://codecov.io
[actions/setup-node]: https://github.com/actions/setup-node
[build-docker-image]: #build-docker-image
Expand Down
30 changes: 30 additions & 0 deletions rebase/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Rebase'
description: 'Rebase and update one branch with another.'

inputs:
target:
description: 'Target branch you wish to update.'
required: true

base:
description: 'Base branch to use to rebase target.'
required: true

runs:
using: composite
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_REPO_TOKEN }}
ref: ${{ inputs.target }}
fetch-depth: 0

- uses: myparcelnl/actions/setup-git-credentials@main

- name: 'Rebase and push'
if: inputs.target && inputs.base
shell: bash
run: |
git config --list
git rebase "origin/${{ inputs.base }}"
git push

0 comments on commit a653be5

Please sign in to comment.