Open colin-gourlay opened 3 weeks ago
Hello, I made an action for creating tags and releases, but I am not sure about the format for the tags and releases. Here is the output it creates:
v20240623145259
Changes in this Release:
- First Change
- Second Change
Here is the code:
name: Create Tag and Release
on:
push:
branches:
- main
jobs:
create_tag_and_release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Git
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
- name: Get the current date
id: date
run: echo "date=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Create a new tag
run: |
git tag v${{ env.date }}
git push origin v${{ env.date }}
- name: Create a release
uses: actions/create-release@v1
with:
tag_name: v${{ env.date }}
release_name: v${{ env.date }}
body: |
Changes in this Release:
- First Change
- Second Change
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Automagically create tags and releases