Refactor release.yml to extract local tag for tag_name and release_name #52
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: Release for Figma | |
on: | |
push: | |
branches: | |
- ui-color-palette-* | |
pull_request: | |
types: | |
- closed | |
branches: | |
- ui-color-palette-* | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Extract local tag | |
id: extract_tag | |
run: | | |
local_tag=$(git tag --points-at HEAD | head -n 1) | |
echo "::set-output name=local_tag::$local_tag" | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.extract_tag.outputs.local_tag }} | |
release_name: Release ${{ steps.extract_tag.outputs.local_tag }} | |
body: | | |
## What's Changed | |
[Friendly release note](https://ui-color-palette.canny.io/changelog/${{ github.ref_name }})・[Full Changelog](https://github.com/inVoltag/figma-ui-color-palette/commits/${{ github.ref_name }}) |