Skip to content

Commit

Permalink
ci: fix commit change version
Browse files Browse the repository at this point in the history
  • Loading branch information
darakeon committed Sep 15, 2024
1 parent b63741e commit 714d3d6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,23 @@ jobs:
- run:
name: change version of csproj changed files
command: python .github/change-version.py
- run:
name: add, commit and push
command: |
if [ -e file_path ]; then
eval "$(ssh-agent -s)"
echo "$GITHUB_CIRCLE_PK" | sed "s/\\\n/\n/g" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-add ~/.ssh/id_ed25519
git config --global user.email "$GITHUB_CIRCLE_EMAIL"
git config --global user.name "$GITHUB_CIRCLE_NAME"
git add $(cat file_path)
git commit -m "$(cat commit_message)"
git push --set-upstream origin $CIRCLE_BRANCH
fi
workflows:
version: 2.1
Expand Down
8 changes: 5 additions & 3 deletions .github/change-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def terminal(command):
with open(file_path, 'w') as file:
file.write(content)

system(f'git add {file_path}')
system(f'git commit -m "{commit_message}"')
system(f'git push')
with open('file_path', 'w') as file:
file.write(file_path)

with open('commit_message', 'w') as file:
file.write(commit_message)

0 comments on commit 714d3d6

Please sign in to comment.