-
Notifications
You must be signed in to change notification settings - Fork 20
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
1 parent
d7fc6c9
commit ad19882
Showing
1 changed file
with
11 additions
and
12 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 |
---|---|---|
|
@@ -4,10 +4,11 @@ set -e | |
set -x | ||
|
||
VERSION=$(cat package.json | jq -r '.version') | ||
CLONE_DIR="./imx-docs" | ||
INPUT_SOURCE_FOLDER="./docs/" | ||
INPUT_DESTINATION_REPO="immutable/imx-docs" | ||
INPUT_DESTINATION_HEAD_BRANCH="ts-immutable-sdk-docs-$VERSION" | ||
INPUT_DESTINATION_FOLDER="api-docs/sdk-references/ts-immutable-sdk/$VERSION" | ||
INPUT_DESTINATION_FOLDER="imx-docs/api-docs/sdk-references/ts-immutable-sdk/$VERSION" | ||
|
||
if [ -z "$INPUT_PULL_REQUEST_REVIEWERS" ] | ||
then | ||
|
@@ -16,22 +17,21 @@ else | |
PULL_REQUEST_REVIEWERS='-r '$INPUT_PULL_REQUEST_REVIEWERS | ||
fi | ||
|
||
CLONE_DIR=$(mktemp -d) | ||
echo "CLONE_DIR: $CLONE_DIR" | ||
|
||
echo "Cloning destination git repository" | ||
# git clone "https://github.com/$INPUT_DESTINATION_REPO.git" "$CLONE_DIR" | ||
git clone "https://oauth2:$GITHUB_TOKEN@github.com/$INPUT_DESTINATION_REPO.git" "$CLONE_DIR" | ||
# echo "CLONE_DIR: $CLONE_DIR" | ||
# echo "Cloning destination git repository" | ||
# # git clone "https://github.com/$INPUT_DESTINATION_REPO.git" "$CLONE_DIR" | ||
# git clone "https://oauth2:[email protected]/$INPUT_DESTINATION_REPO.git" "$CLONE_DIR" | ||
|
||
echo "Copying contents to git repo" | ||
mkdir -p $CLONE_DIR/$INPUT_DESTINATION_FOLDER/ | ||
mkdir -p $INPUT_DESTINATION_FOLDER | ||
|
||
if [ -d "$CLONE_DIR/$INPUT_DESTINATION_FOLDER/" ]; then | ||
if [ -d "$INPUT_DESTINATION_FOLDER" ]; then | ||
### Take action if $DIR exists ### | ||
cp -r $INPUT_SOURCE_FOLDER "$CLONE_DIR/$INPUT_DESTINATION_FOLDER/" | ||
cp -r $INPUT_SOURCE_FOLDER $INPUT_DESTINATION_FOLDER | ||
else | ||
### Control will jump here if $DIR does NOT exists ### | ||
echo "Error: $CLONE_DIR/$INPUT_DESTINATION_FOLDER/ not found. Can not continue." | ||
echo "Error: $INPUT_DESTINATION_FOLDER not found. Can not continue." | ||
exit 1 | ||
fi | ||
|
||
|
@@ -42,8 +42,7 @@ echo "Adding git commit" | |
git add . | ||
if git status | grep -q "Changes to be committed" | ||
then | ||
# git commit --message "Update from https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" | ||
git commit --message "Foo" | ||
git commit --message "Update from https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" | ||
echo "Pushing git commit" | ||
git push -u origin HEAD:$INPUT_DESTINATION_HEAD_BRANCH | ||
echo "Creating a pull request" | ||
|