All checks were successful
Update changelog / changelog (push) Successful in 26s
Docker images will now be built on every release
38 lines
1.5 KiB
YAML
38 lines
1.5 KiB
YAML
# Credit: https://gitea.com/gitea/helm-gitea/src/branch/main/.gitea/workflows/changelog.yml
|
|
name: Update changelog
|
|
run-name: Update changelog on push
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
changelog:
|
|
runs-on: ubuntu-latest
|
|
container: docker.io/thegeeklab/git-sv:2.0.9
|
|
steps:
|
|
- name: Install tools
|
|
run: |
|
|
apk add -q --update --no-cache nodejs curl jq sed
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Generate upcoming changelog
|
|
run: |
|
|
git sv rn -o changelog.md
|
|
export RELEASE_NOTES=$(cat changelog.md)
|
|
export ISSUE_NUMBER=$(curl -s -H 'Authorization: token ${{ secrets.ISSUE_RW_TOKEN }}' "https://gitea.7o7.cx/api/v1/repos/kittyteam/kittyBE/issues?state=open&q=Changelog%20for%20upcoming%20version" | jq '.[].number')
|
|
|
|
echo $RELEASE_NOTES
|
|
JSON_DATA=$(echo "" | jq -Rs --arg title 'Changelog for upcoming version' --arg body "$(cat changelog.md)" '{title: $title, body: $body}')
|
|
|
|
if [ -z "$ISSUE_NUMBER" ]; then
|
|
curl -s -X POST "https://gitea.7o7.cx/api/v1/repos/kittyteam/kittyBE/issues" -H "Authorization: token ${{ secrets.ISSUE_RW_TOKEN }}" -H "Content-Type: application/json" -d "$JSON_DATA" > /dev/null
|
|
else
|
|
curl -s -X PATCH "https://gitea.7o7.cx/api/v1/repos/kittyteam/kittyBE/issues/$ISSUE_NUMBER" -H "Authorization: token ${{ secrets.ISSUE_RW_TOKEN }}" -H "Content-Type: application/json" -d "$JSON_DATA" > /dev/null
|
|
fi
|