File tree Expand file tree Collapse file tree 2 files changed +54
-2
lines changed
Expand file tree Collapse file tree 2 files changed +54
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Check branch changes
2+ on :
3+ workflow_call :
4+ inputs :
5+ branch :
6+ required : true
7+ type : string
8+ outputs :
9+ has_changes :
10+ value : ${{ jobs.check.outputs.has_changes }}
11+
12+ jobs :
13+ check :
14+ runs-on : ubuntu-latest
15+ outputs :
16+ has_changes : ${{ steps.commit_check.outputs.has_changes }}
17+
18+ steps :
19+ - uses : actions/checkout@v4
20+ with :
21+ fetch-depth : 0
22+ ref : ${{ inputs.branch }}
23+
24+ - id : commit_check
25+ run : |
26+ COUNT=$(git log --oneline --since='24 hours ago' | wc -l)
27+ echo "Found $COUNT commits in the last 24 hours on branch ${{ inputs.branch }}"
28+
29+ if [ "$COUNT" -gt 0 ]; then
30+ echo "has_changes=true" >> $GITHUB_OUTPUT
31+ else
32+ echo "has_changes=false" >> $GITHUB_OUTPUT
33+ fi
Original file line number Diff line number Diff line change @@ -11,15 +11,34 @@ permissions:
1111 id-token : write # For publishing on NPM using OIDC
1212
1313jobs :
14- npm-reanimated-4-publish-nightly :
14+ check-v4-changes :
1515 if : github.repository == 'software-mansion/react-native-reanimated'
16+ uses : ./.github/workflows/check-branch-changes.yml
17+ with :
18+ branch : main
19+
20+ npm-reanimated-4-publish-nightly :
21+ needs : check-v4-changes
22+ if : |
23+ github.repository == 'software-mansion/react-native-reanimated' &&
24+ needs.check-v4-changes.outputs.has_changes == 'true'
1625 uses : ./.github/workflows/npm-reanimated-package-build.yml
1726 with :
1827 option : --nightly
1928 publish_on_npm : true
2029
21- npm-reanimated-3-publish-nightly :
30+ check-v3-changes :
2231 if : github.repository == 'software-mansion/react-native-reanimated'
32+ uses : ./.github/workflows/check-branch-changes.yml
33+ with :
34+ # Remember to update the branch on new minor releases.
35+ branch : 3.19-stable
36+
37+ npm-reanimated-3-publish-nightly :
38+ needs : check-v3-changes
39+ if : |
40+ github.repository == 'software-mansion/react-native-reanimated' &&
41+ needs.check-v3-changes.outputs.has_changes == 'true'
2342 uses : ./.github/workflows/npm-reanimated-package-build.yml
2443 with :
2544 option : --nightly
You can’t perform that action at this time.
0 commit comments