Skip to content

Auto Generate Release Log #5

Auto Generate Release Log

Auto Generate Release Log #5

Workflow file for this run

name: Auto Generate Release Log
on:
workflow_dispatch:
inputs:
tag_name:
required: true
type: string
previous_tag_name:
required: true
type: string
target_commitish:
required: true
type: string
permissions:
contents: write
pull-requests: write
jobs:
generate_changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v4
with:
go-version: "1.20.2"
- name: set version
run: |
echo "VERSION=$(echo "${{inputs.tag_name}}" | cut -d '-' -f1)" >> "$GITHUB_ENV"
- name: generate changelog
run: |
set -e
response=$(curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/Edgenesis/shifu/releases/generate-notes \
-d '{"tag_name":"${{inputs.tag_name}}","target_commitish":"${{inputs.target_commitish}}","previous_tag_name":"${{inputs.previous_tag_name}}"}')
echo $response
go run tools/release/release.go "$response"
env:
AZURE_OPENAI_APIKEY: ${{ secrets.AZURE_OPENAI_APIKEY }}
AZURE_OPENAI_HOST: ${{ secrets.AZURE_OPENAI_HOST }}
DEPLOYMENT_NAME: ${{secrets.DEPLOYMENT_NAME}}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: add changelog for ${{env.VERSION}}
title: add changelog for ${{env.VERSION}}
body: add changelog for ${{env.VERSION}}
branch: changelog-${{env.VERSION}}
base: main