Skip to content

Commit 6096223

Browse files
authored
Update patch.yml
1 parent 9503776 commit 6096223

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.github/workflows/patch.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,34 @@ on: workflow_dispatch
77
# - cron: "0 13 * * 1"
88

99
jobs:
10-
setup-env:
10+
setup-outputs:
1111
runs-on: ubuntu-latest
12-
12+
outputs:
13+
currentTag: ${{ steps.step1.outputs.currentTag }}
14+
commitCount: ${{ steps.step2.outputs.commitCount }}
15+
newTag: ${{ steps.step3.outputs.newTag }}
1316
steps:
1417
- uses: actions/checkout@v5
1518
with:
1619
fetch-depth: 0
17-
18-
- run: echo "CURRENT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_OUTPUT
19-
- run: echo "COMMIT_COUNT=`echo $(git rev-list --count $CURRENT_TAG..master)`" >> $GITHUB_OUTPUT
20-
- if: ${{env.COMMIT_COUNT >= 5}}
21-
run: echo "NEW_TAG=echo $CURRENT_TAG | awk 'BEGIN{FS=OFS="."} {$3+=1} 1'" >> $GITHUB_OUTPUT
20+
- id: step1
21+
run: echo "currentTag=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_OUTPUT
22+
- id: step2
23+
run: echo "commitCount=`echo $(git rev-list --count $CURRENT_TAG..master)`" >> $GITHUB_OUTPUT
24+
- if: ${{outputs.commitCount >= 5}}
25+
id: step3
26+
run: echo "newTag=echo $outputs.current-tag | awk 'BEGIN{FS=OFS="."} {$3+=1} 1'" >> $GITHUB_OUTPUT
2227
- name: Environments
2328
run: |
24-
echo "CURRENT_TAG: $CURRENT_TAG"
25-
echo "NEW_TAG: $NEW_TAG"
26-
echo "COMMIT_COUNT: $COMMIT_COUNT"
29+
echo "currentTag: $outputs.currentTag"
30+
echo "commitCount: $outputs.commitCount"
31+
echo "newTag: $outputs.newTag"
2732
make-patch:
28-
needs: setup-env
33+
needs: setup-outputs
2934

3035
runs-on: ubuntu-latest
3136

32-
if: ${{needs.setup-env.outputs.COMMIT_COUNT >= 5}}
37+
if: ${{needs.setup-outputs.outputs.commitCount >= 5}}
3338
steps:
3439
- uses: actions/checkout@v5
3540
with:

0 commit comments

Comments
 (0)