Skip to content

Commit 8da3776

Browse files
authored
Update main.yml
1 parent 3ade062 commit 8da3776

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/main.yml

+14-4
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,27 @@ jobs:
5050
steps:
5151
- uses: actions/checkout@v3
5252
with:
53-
fetch-depth: 0
53+
fetch-depth: 0
5454
- name: Install jstyleson
5555
run: pip3 install jstyleson
5656
- name: Update size
5757
run: python3 .github/update_size.py
58-
- name: Switch to develop branch
58+
59+
- name: Determine branch and switch
60+
id: branch_info
5961
run: |
60-
git checkout develop
61-
- name: Commit changes
62+
if [ -z "$GITHUB_HEAD_REF" ]; then
63+
branch_name=$(git symbolic-ref --short HEAD)
64+
else
65+
branch_name=$GITHUB_HEAD_REF
66+
fi
67+
echo "branch_name=$branch_name" >> $GITHUB_ENV
68+
echo "Switched to branch: $branch_name"
69+
70+
- name: Commit changes to the correct branch
6271
uses: EndBug/add-and-commit@v9
6372
with:
6473
default_author: github_actions
6574
message: Update sizes
6675
add: '*.json'
76+
push: --force

0 commit comments

Comments
 (0)