Skip to content

[GitHub] Mark release as pre-release #48

[GitHub] Mark release as pre-release

[GitHub] Mark release as pre-release #48

# 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}'