Merge pull request #55 from devchat-ai/improve-ci-message

Imporve sync action message
This commit is contained in:
kagami 2024-05-15 13:23:30 +08:00 committed by GitHub
commit 61e45a6827
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,7 @@ jobs:
cd ./temp/devchat-repo
DEVCHAT_HEXSHA=$(git rev-parse HEAD | cut -c 1-8)
DEVCHAT_BRANCH=$(git branch --show-current)
DEVCHAT_MESSAGE_=$(git log -1 --pretty=%s)
pip install --no-binary :all: "pydantic==1.10.14"
pip install charset-normalizer --no-binary :all:
pip install git+https://github.com/devchat-ai/tiktoken.git
@ -71,6 +72,7 @@ jobs:
echo "DEVCHAT_HEXSHA=$DEVCHAT_HEXSHA" >> $GITHUB_ENV
echo "DEVCHAT_BRANCH=$DEVCHAT_BRANCH" >> $GITHUB_ENV
echo "DEVCHAT_MESSAGE=$DEVCHAT_MESSAGE" >> $GITHUB_ENV
- name: Commit, Push and Create PR
run: |
@ -81,13 +83,13 @@ jobs:
git checkout -b $BRANCH_NAME
git diff --stat
git add ./site-packages
git commit -m "Sync up site-packages to devchat[$DEVCHAT_BRANCH]($DEVCHAT_HEXSHA)"
git commit -m "Sync: devchat[$DEVCHAT_BRANCH]($DEVCHAT_HEXSHA) $DEVCHAT_MESSAGE"
git status
git push origin $BRANCH_NAME
echo -e "This PR is auto-generated by GitHub Action. \n- devchat branch: \`$DEVCHAT_BRANCH\` \n- devchat hexsha: \`$DEVCHAT_HEXSHA\` \n- actor: ${{ github.triggering_actor }}" > pr_body
echo -e "This PR is auto-generated by GitHub Action. \n- devchat branch: \`$DEVCHAT_BRANCH\` \n- devchat hexsha: \`$DEVCHAT_HEXSHA\` \n- message: $DEVCHAT_MESSAGE \n- actor: ${{ github.triggering_actor }}" > pr_body
PR_BODY=$(cat pr_body)
gh pr create \
--title "Sync up site-packages to devchat[$DEVCHAT_BRANCH]($DEVCHAT_HEXSHA) $TIMESTAMP" \
--title ":arrows_counterclockwise: Sync: devchat[$DEVCHAT_BRANCH]($DEVCHAT_HEXSHA) $TIMESTAMP" \
--body "$PR_BODY" \
--draft \
--base main \