21 lines
567 B
YAML
21 lines
567 B
YAML
- name: push-to-github
|
|
image: alpine/git
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: GITHUB_TOKEN
|
|
when:
|
|
status: [ success ]
|
|
commands:
|
|
- echo "Verifying local git integrity..."
|
|
- git fsck --full
|
|
|
|
- git config --global user.name "woodpecker"
|
|
- git config --global user.email "ci@localhost"
|
|
|
|
- git remote add github https://$GITHUB_TOKEN@github.com/Magiciian/dummy-app.git
|
|
|
|
# Pull latest main before push
|
|
- git fetch github main
|
|
- git rebase github/main
|
|
|
|
- git push github HEAD:main |