@@ -2,8 +2,6 @@ name: Gradle Publish [snapshot]
22
33on :
44 workflow_dispatch :
5- schedule :
6- - cron : " 0 15 * * 5" # friday 15:00 UTC
75
86jobs :
97 check-branch :
@@ -14,42 +12,14 @@ jobs:
1412 if : startsWith(github.ref, 'refs/heads/')
1513 run : |
1614 BRANCH="${GITHUB_REF#refs/heads/}"
17- if [[ "$BRANCH" != "main" && "$BRANCH" != "dev" && "$BRANCH" != dev-* && "$BRANCH" != release-* ]]; then
18- echo "::error title=wrong branch selected::this workflow must be run on 'main', 'dev', 'dev-*' or 'release-*' branches"
15+ if [[ "$BRANCH" != "main" && "$BRANCH" != release-* ]]; then
16+ echo "::error title=wrong branch selected::this workflow must be run on 'main' or 'release-*' branches"
1917 exit 1
2018 fi
2119
22- check-updates :
23- name : Check Updates
24- runs-on : ubuntu-latest
25- outputs :
26- should_run : ${{ steps.check.outputs.should_run }}
27- steps :
28- - name : Checkout
29- uses : actions/checkout@v5
30- with :
31- fetch-depth : 50
32-
33- - name : Check if SNAPSHOT publish is applicable
34- id : check
35- run : |
36- if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
37- echo "::notice::publish will always execute on manual trigger"
38- echo "should_run=true" >> $GITHUB_OUTPUT
39- else
40- if git log --since="7 days ago" --oneline | grep .; then
41- echo "::notice::commits found within last 7 days window, publish will execute"
42- echo "should_run=true" >> $GITHUB_OUTPUT
43- else
44- echo "::notice::no commits found within last 7 days window, publish will abort"
45- echo "should_run=false" >> $GITHUB_OUTPUT
46- fi
47- fi
48-
4920 publish-snapshot :
5021 name : Publish problem4j-spring SNAPSHOT
51- needs : [ check-branch, check-updates ]
52- if : needs.check-updates.outputs.should_run == 'true'
22+ needs : [ check-branch ]
5323 runs-on : ubuntu-latest
5424 steps :
5525 - name : Checkout
0 commit comments