-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Qu4k
committed
Jul 20, 2020
0 parents
commit 8b6aa8b
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM alpine:3.9 | ||
|
||
RUN apk --no-cache add openssl git curl openssh-client bash | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT [ "/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# push | ||
|
||
Push changes made by actions right back into the current repository. | ||
|
||
```yml | ||
uses: actions-js/push@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: 'Push' | ||
description: 'Push changes made by actions right back into the current repository.' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
branding: | ||
icon: 'arrow-up-circle' | ||
color: 'green' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
|
||
# a github token is needed to grant | ||
# push priviledges for the current repo | ||
if [ -z "${GITHUB_TOKEN}" ]; then | ||
echo "error: not found GITHUB_TOKEN" | ||
exit 1 | ||
fi | ||
|
||
repository="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | ||
|
||
git config http.sslVerify false | ||
git config user.name "Push Bot" | ||
git config user.email "[email protected]" | ||
git remote add publisher "${repository}" | ||
|
||
git show-ref | ||
git branch --verbose | ||
|
||
# publish any new files | ||
git checkout master | ||
git add -A | ||
|
||
timestamp=$(date -u) | ||
git commit -m "Automated push: ${timestamp} ${GITHUB_SHA}" || exit 0 | ||
|
||
git pull --rebase publisher master | ||
git push publisher master |