Skip to content
This repository was archived by the owner on Dec 30, 2022. It is now read-only.

Commit 24dcf85

Browse files
committed
delete only drafts for current branch
1 parent 3b9109d commit 24dcf85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
run: |
3939
PROPERTIES="$(./gradlew properties --console=plain -q)"
4040
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
41+
TARGET="$(echo "$PROPERTIES" | grep "^release_target:" | cut -f2- -d ' ')"
4142
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
4243
CHANGELOG="${CHANGELOG//'%'/'%25'}"
4344
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
@@ -76,7 +77,7 @@ jobs:
7677
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7778
run: |
7879
gh api repos/{owner}/{repo}/releases \
79-
--jq '.[] | select(.draft == true) | .id' \
80+
--jq '.[] | select(.draft == true) | select(.target_commitish=="${{ needs.build.outputs.target }}") | .id' \
8081
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
8182
# Create new release draft - which is not publicly visible and requires manual acceptance
8283
- name: Create Release Draft

0 commit comments

Comments
 (0)