-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: shanexi <[email protected]> Co-authored-by: joe <[email protected]>
- Loading branch information
1 parent
9a58470
commit db820a8
Showing
11 changed files
with
177 additions
and
34 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,47 @@ | ||
name: Sync open-source main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "web/apps/web/**" | ||
- "web/packages/**" | ||
- ".github/**" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get last commit author email | ||
id: get_email | ||
run: echo "COMMIT_AUTHOR_EMAIL=$(git log -n 1 --pretty=format:%ae)" >> $GITHUB_ENV | ||
|
||
- name: Test author email | ||
run: echo "The commit author email is $COMMIT_AUTHOR_EMAIL" | ||
|
||
- name: Get last commit author name | ||
id: get_name | ||
run: echo "COMMIT_AUTHOR_NAME=$(git log -n 1 --pretty=format:%an)" >> $GITHUB_ENV | ||
|
||
- name: Test author name | ||
run: echo "The commit author name is $COMMIT_AUTHOR_NAME" | ||
|
||
- uses: cpina/github-action-push-to-another-repository@main | ||
env: | ||
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | ||
with: | ||
source-directory: web | ||
target-directory: web | ||
destination-github-username: "myshell-ai" | ||
destination-repository-name: "open-source" | ||
target-branch: main | ||
create-target-branch-if-needed: false | ||
user-name: ${{ env.COMMIT_AUTHOR_NAME }} | ||
user-email: ${{ env.COMMIT_AUTHOR_EMAIL }} | ||
|
||
- name: Test get variable exported by push-to-another-repository | ||
run: echo $DESTINATION_CLONED_DIRECTORY |
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,19 @@ | ||
#!/bin/sh | ||
# . "$(dirname "$0")/_/husky.sh" | ||
|
||
|
||
echo "===\n>> Pre-push Hook: Checking branch name..." | ||
|
||
cd web | ||
|
||
BRANCH=`git rev-parse --abbrev-ref HEAD` | ||
PROTECTED_BRANCHES="^(main|test)" | ||
|
||
if [[ "$BRANCH" =~ $PROTECTED_BRANCHES ]] | ||
then | ||
echo "\n🚫 Cannot push to remote $BRANCH branch, please create your own branch and use PR." | ||
fi | ||
|
||
echo ">> Finish checking branch name.\n===" | ||
|
||
exit 0 |
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
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
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
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
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
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
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
Oops, something went wrong.