Background Uploading Example #133
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
name: Draft a new release | |
on: | |
pull_request: | |
types: [ closed ] | |
jobs: | |
draft: | |
# Change the quoted text to match your release branch naming convention | |
if: startsWith(github.head_ref, 'releases/v') && github.event.pull_request.merged | |
runs-on: ubuntu-latest | |
name: Create the Release on the destination branch | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Parse the tag name out of the release branch | |
id: version | |
run: > | |
echo "tag_name="$(echo ${{ github.head_ref }} | grep -E "^release.?[\/-]" | sed -E "s/release.?[\/-]//")"" >> $GITHUB_OUTPUT | |
- name: Create the release | |
id: release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.version.outputs.tag_name }} | |
release_name: ${{ steps.version.outputs.tag_name }} | |
body: ${{ github.event.pull_request.body }} | |
commitish: ${{ github.event.pull_request.merge_commit_sha }} | |
draft: true | |
- uses: mshick/add-pr-comment@v1 | |
name: Link the Release to the PR | |
with: | |
message: A draft release has been created for this version. Find it here! ${{ steps.release.outputs.html_url }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens | |
allow-repeats: false |