Skip to content

Update README.md

Update README.md #37

# This is a basic workflow to help you get started with Actions
name: Create Release Notes after CI
# Controls when the workflow will run
on:
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
microservice:
required: true
type: string
description: Name of Microservice
default: apple
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Set version tag
id: set-version
run: |
MICROSERVICE=${{ inputs.microservice }}
echo "microservice=${MICROSERVICE:=apple}" >> $GITHUB_OUTPUT
echo "tag=v$(date '+%Y%m%d%H%M')" >> $GITHUB_OUTPUT
- name: Write a release log
uses: cuchi/jinja2-action@v1.2.0
with:
template: RELEASE-LOG.md
output_file: RELEASE-LOG.md
env:
RELEASE_SUMMARY: 'This contains a breaking change on apple.'
COMMIT_HISTORY: '- [APPLE-123] New change on apple microservice (#2) @lucetre'
- name: Create a tag on the input commit (gh-cli)
run: |
gh release create "${{ env.MICROSERVICE }}/${{ env.CURR_VERSION_TAG }}" \
--title "${{ env.MICROSERVICE }}: ${{ env.CURR_VERSION_TAG }}" \
--target ${{ env.COMMIT_SHA }} \
--notes-start-tag "${{ env.MICROSERVICE }}/${{ env.PREV_VERSION_TAG }}" \
--generate-notes \
--notes-file RELEASE-LOG.md
env:
GH_TOKEN: ${{ github.token }}
MICROSERVICE: ${{ steps.set-version.outputs.microservice }}
PREV_VERSION_TAG: v202310080646
CURR_VERSION_TAG: ${{ steps.set-version.outputs.tag }}
COMMIT_SHA: ${{ github.sha }}