Skip to content

Commit 752a381

Browse files
authored
Merge pull request #74 from GeorgeK1ng/develop
Workflow tweak
2 parents 7ff4064 + 1fd626b commit 752a381

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

.github/workflows/main.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313

1414
jobs:
1515
validate_json:
16+
if: ${{ github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
1617
runs-on: ubuntu-latest
1718
defaults:
1819
run:
@@ -29,6 +30,7 @@ jobs:
2930
run: python3 .github/validate_json.py
3031

3132
validate_mod_json:
33+
if: ${{ github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
3234
needs: validate_json
3335
runs-on: ubuntu-latest
3436
defaults:
@@ -42,7 +44,7 @@ jobs:
4244
run: python3 .github/validate_mod_json.py
4345

4446
update_size:
45-
needs: validate_json
47+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
4648
runs-on: ubuntu-latest
4749
defaults:
4850
run:
@@ -60,13 +62,8 @@ jobs:
6062
- name: Determine branch and switch
6163
id: branch_info
6264
run: |
63-
if [ -z "$GITHUB_HEAD_REF" ]; then
64-
branch_name=$(git symbolic-ref --short HEAD)
65-
else
66-
branch_name=$GITHUB_HEAD_REF
67-
fi
65+
branch_name=$(git symbolic-ref --short HEAD)
6866
echo "branch_name=$branch_name" >> $GITHUB_ENV
69-
git checkout $branch_name || git checkout -b $branch_name
7067
echo "Checked out branch: $branch_name"
7168
7269
- name: Set upstream for branch

0 commit comments

Comments
 (0)