diff --git a/.github/scripts/create_draft_release.sh b/.github/scripts/create_draft_release.sh index ea98378bb..588704fa8 100755 --- a/.github/scripts/create_draft_release.sh +++ b/.github/scripts/create_draft_release.sh @@ -9,7 +9,6 @@ set -E # needs to be set if we want the ERR trap set -o pipefail # prevents errors in a pipeline from being masked RELEASE_TAG=$1 -IS_LATEST_RELEASE=$2 REPOSITORY=${REPOSITORY:-kyma-project/serverless-manager} GITHUB_URL=https://api.github.com/repos/${REPOSITORY} @@ -20,13 +19,11 @@ JSON_PAYLOAD=$(jq -n \ --arg tag_name "$RELEASE_TAG" \ --arg name "$RELEASE_TAG" \ --arg body "$CHANGELOG_FILE" \ - --arg is_latest "$IS_LATEST_RELEASE" \ '{ "tag_name": $tag_name, "name": $name, "body": $body, - "draft": true, - "make_latest": $is_latest + "draft": true }') CURL_RESPONSE=$(curl -L \ diff --git a/.github/scripts/publish_release.sh b/.github/scripts/publish_release.sh index 3205ef73c..8110d3101 100755 --- a/.github/scripts/publish_release.sh +++ b/.github/scripts/publish_release.sh @@ -9,6 +9,7 @@ set -E # needs to be set if we want the ERR trap set -o pipefail # prevents errors in a pipeline from being masked RELEASE_ID=$1 +IS_LATEST_RELEASE=$2 REPOSITORY=${REPOSITORY:-kyma-project/serverless-manager} GITHUB_URL=https://api.github.com/repos/${REPOSITORY} @@ -20,4 +21,4 @@ CURL_RESPONSE=$(curl -L \ -H "${GITHUB_AUTH_HEADER}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ ${GITHUB_URL}/releases/${RELEASE_ID} \ - -d '{"draft": false}') + -d '{"draft": false, "make_latest": '"$IS_LATEST_RELEASE"'}') diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index e631bb4dc..ac1b3e35e 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -85,7 +85,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - RELEASE_ID=$(./.github/scripts/create_draft_release.sh ${{ github.event.inputs.name }} ${{ github.event.inputs.latest_release }}) + RELEASE_ID=$(./.github/scripts/create_draft_release.sh ${{ github.event.inputs.name }}) echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT - name: Create lightweight tag @@ -122,4 +122,4 @@ jobs: - name: Publish release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./.github/scripts/publish_release.sh ${{ needs.create-draft.outputs.release_id }} + run: ./.github/scripts/publish_release.sh ${{ needs.create-draft.outputs.release_id }} ${{ github.event.inputs.latest_release }}