mirror of
https://github.com/cpina/github-action-push-to-another-repository.git
synced 2024-12-22 16:16:09 -07:00
Updates file adding the code to push
This commit is contained in:
parent
d17570f574
commit
8956a2d3f2
|
@ -1,5 +1,7 @@
|
||||||
FROM alpine:3.10
|
FROM alpine:3.10
|
||||||
|
|
||||||
|
RUN apk add --no-cache git
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
|
@ -1,7 +1,33 @@
|
||||||
#!/bin/sh -l
|
#!/bin/sh -l
|
||||||
|
|
||||||
echo "Starts"
|
echo "Starts"
|
||||||
echo "1: $1"
|
FOLDER="$1"
|
||||||
echo "2: $2"
|
GITHUB_USERNAME="$2"
|
||||||
echo "3: $3"
|
GITHUB_REPO="$3"
|
||||||
echo "Ends
|
|
||||||
|
git config --global user.email "carles@pina.cat"
|
||||||
|
git config --global user.name "$GITHUB_USERNAME"
|
||||||
|
|
||||||
|
git clone "https://$API_TOKEN_GITHUB@github.com/$GITHUB_USERNAME/$GITHUB_REPO.git" "$CLONE_DIR"
|
||||||
|
|
||||||
|
ls -l
|
||||||
|
|
||||||
|
cd "$CLONE_DIR"
|
||||||
|
# find needs to be in the git repository directory
|
||||||
|
find . | grep -v ".git" | grep -v "^\.*$" | xargs rm -rf # delete all files (to handle deletions)
|
||||||
|
|
||||||
|
cp -r "../$FOLDER"/* .
|
||||||
|
|
||||||
|
echo "After cd $CLONE_DIR"
|
||||||
|
|
||||||
|
ls -la
|
||||||
|
|
||||||
|
git add .
|
||||||
|
git commit --message "Update from $GITHUB_REPOSITORY"
|
||||||
|
git push origin master
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
|
|
||||||
|
echo "Ends"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user