[GitHub] Mark release as pre-release #48
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: this action fix the issue with the helm-releaser action | |
# not marking the release as pre-release | |
name: "[GitHub] Mark release as pre-release" | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
mark_prerelease: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if release is a candidate (RC) | |
id: check_rc | |
run: | | |
if [[ "${GITHUB_REF_NAME}" == *-rc.* ]]; then | |
echo "IS_RC=true" >> $GITHUB_ENV | |
else | |
echo "IS_RC=false" >> $GITHUB_ENV | |
fi | |
- name: Mark as pre-release | |
if: env.IS_RC == 'true' | |
run: | | |
curl \ | |
-X PATCH \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.PAT }}" \ | |
https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }} \ | |
-d '{"prerelease": true}' |