This repository was archived by the owner on Dec 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 75
75
run : |
76
76
git add VERSION
77
77
git commit -m "Increment version to ${{ steps.do_version_increment.outputs.new_version }}"
78
+ git pull --rebase
78
79
git push
79
80
80
81
# Step 6: Update the git hash in the repository
83
84
python3 get_git_version.py > git_commit_hash.txt
84
85
git add git_commit_hash.txt
85
86
git commit -m "Updated git_commit_hash.txt"
87
+ git pull --rebase
86
88
git push
87
89
88
90
# Step 7: Install required dependencies
Original file line number Diff line number Diff line change 22
22
python-version : ${{ env.python_version }}
23
23
24
24
- name : Format modified python files
25
+ env :
26
+ filter : ${{ github.event.before }}
25
27
run : |
26
28
python3 -m pip install autopep8
27
- for FILE in $(git diff --name-only ${{ github.event.before }} | grep -E '.*\.py$')
29
+ for FILE in $(git diff --name-only $filter | grep -E '.*\.py$')
28
30
do
29
31
# Check if the file still exists in the working tree
30
32
if [ -f "$FILE" ]; then
34
36
done
35
37
36
38
- name : Format modified C++ files
39
+ env :
40
+ filter : ${{ github.event.before }}
37
41
run : |
38
- for FILE in $(git diff --name-only ${{ github.event.before }} | grep -E '.*\.(cc|cpp|h|hpp)$')
42
+ for FILE in $(git diff --name-only $filter | grep -E '.*\.(cc|cpp|h|hpp)$')
39
43
do
40
44
# Check if the file still exists in the working tree
41
45
if [ -f "$FILE" ]; then
44
48
fi
45
49
done
46
50
47
- - name : Commit and create PR
51
+ - name : Commit and Push
48
52
run : |
49
53
HAS_CHANGES=$(git diff --staged --name-only)
50
54
if [ ${#HAS_CHANGES} -gt 0 ]; then
54
58
git commit -m '[Automated Commit] Format Codebase'
55
59
git push
56
60
57
- # Push changes to a new branch
58
- # BRANCH_NAME="auto/code-format"
59
- # git branch $BRANCH_NAME
60
- # git push origin $BRANCH_NAME --force
61
-
62
- # Create a pull request to the "code-format" branch
63
- # gh pr create --base code-format --head $BRANCH_NAME --title "[Automated PR] Format Codebase" --body "This pull request contains automated code formatting changes."
64
61
fi
65
- # env:
66
- # GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
You can’t perform that action at this time.
0 commit comments