Created
October 12, 2022 04:46
-
-
Save bxb100/d2fedcb3cdc897062ee03920d6ae83be to your computer and use it in GitHub Desktop.
create draft release
This file contains hidden or 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
create_draft_release: | |
name: Create Github draft release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Audit gh version | |
run: gh --version | |
- name: Check for existing release | |
id: check_release | |
run: | | |
echo "::echo::on" | |
gh release view --repo '${{ github.repository }}' '${{ github.event.inputs.tag }}' \ | |
&& echo "::set-output name=already_exists::true" \ | |
|| echo "::set-output name=already_exists::false" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout repo | |
if: steps.check_release.outputs.already_exists == 'false' | |
uses: actions/checkout@v3 | |
with: | |
ref: "${{ github.event.inputs.ref }}" | |
- name: Create release | |
if: steps.check_release.outputs.already_exists == 'false' | |
run: > | |
gh release create | |
'${{ github.event.inputs.tag }}' | |
--draft | |
--repo '${{ github.repository }}' | |
--title '${{ github.event.inputs.tag }}' | |
--target '${{ github.event.inputs.ref }}' | |
--generate-notes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment