Skip to content

Commit

Permalink
add example to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed May 11, 2019
1 parent f3527f6 commit 383b0b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# mirror-action
A GitHub Action for mirroring your repository to a different remote repository

This project is [mirrored on GitLab](https://gitlab.com/spyoungtech/mirror-action)

## Example workflow

```workflow
workflow "Mirror Workflow" {
on = "push"
resolves = ["Mirror Action"]
}
action "Mirror Action" {
uses = "spyoungtech/mirror-action@master"
secrets = ["GIT_PASSWORD"]
args = "https://gitlab.com/spyoungtech/mirror-action.git"
env = {
GIT_USERNAME = "spyoungtech"
}
}
```
1 change: 0 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ sh -c "git config --global credential.username $GIT_USERNAME"
sh -c "git config --global core.askPass /cred-helper.sh"
sh -c "git config --global credential.helper cache"
sh -c "git remote add mirror $*"
sh -c "git remote set-url $*"
sh -c "echo pushing to $branch branch at $(git remote get-url --push mirror)"
sh -c "git push mirror $branch"

0 comments on commit 383b0b6

Please sign in to comment.