File tree Expand file tree Collapse file tree 1 file changed +11
-16
lines changed Expand file tree Collapse file tree 1 file changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -22,23 +22,18 @@ jobs:
2222 if : github.event.inputs.version != null
2323 run : echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
2424
25- - uses : actions/github-script@v7
25+ - name : Get latest draft release title
2626 if : github.event.inputs.version == null
27- id : candidate-version
28- with :
29- github-token : ${{secrets.GITHUB_TOKEN}}
30- result-encoding : string
31- script : |
32- const list = await github.rest.repos.listReleases({
33- owner: "domaframework",
34- repo: "doma",
35- });
36- console.log(list)
37- return list.data[0].name
38-
39- - name : Assign candidate version
40- if : github.event.inputs.version == null
41- run : echo "RELEASE_VERSION=${{ steps.candidate-version.outputs.result }}" >> $GITHUB_ENV
27+ run : |
28+ TITLE=$(gh api repos/${{ github.repository }}/releases \
29+ --jq '.[] | select(.draft==true) | .name' | head -n 1)
30+ if [[ -z "$TITLE" ]]; then
31+ echo "No draft release found."
32+ exit 1
33+ fi
34+ echo "RELEASE_VERSION=$TITLE" >> $GITHUB_ENV
35+ env :
36+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4237
4338 - name : Set up the latest LTS JDK
4439 uses : actions/setup-java@v4
You can’t perform that action at this time.
0 commit comments