site/.forgejo/workflows/release-notes.yml
Workflow config file is invalid. Please check your config file: Line: 10 Column 11: Failed to match job-factory: Line: 31 Column 18: Failed to match run-step: Line: 32 Column 23: Unknown Variable Access gitea Line: 32 Column 23: Unknown Variable Access gitea Line: 32 Column 23: Unknown Variable Access gitea Line: 32 Column 23: Unknown Variable Access gitea Line: 31 Column 18: Failed to match regular-step: Line: 32 Column 18: Unknown Property run Line: 10 Column 11: Failed to match workflow-job: Line: 12 Column 11: Unknown Property steps Forgejo Actions YAML Schema validation error
g_it 6c46cc09bc
All checks were successful
Spell Check / Check spelling (push) Successful in 8s
vale / runner / vale (push) Successful in 4s
Add draft releases workflow.
2026-04-09 00:54:07 +02:00

42 lines
1.7 KiB
YAML

name: Create Draft Release Notes
on:
push:
tags:
- "v*"
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
run: |
git clone --depth 1 https://token:${{ secrets.ACTIONS_TOKEN }}@gugulet.hu/technical/git/g_it/site.git .
- name: Generate release notes
id: notes
run: |
CURRENT_TAG=$(git describe --tags --exact-match)
PREVIOUS_TAG=$(git tag --sort=-version:refname --list | awk "NR>1 {print; exit}")
if [ -z "$PREVIOUS_TAG" ]; then
CHANGELOG=$(git log --pretty=format:"- %s" --no-decorate)
else
CHANGELOG=$(git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:"- %s" --no-decorate)
fi
echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT
- name: Create release via Forgejo API
run: |
curl -X POST https://${{ gitea.server }}/api/v1/repos/${{ gitea.repository }}/releases \
-H "Authorization: token ${{ secrets.ACTIONS_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "${{ gitea.ref_name }}",
"name": "Release ${{ gitea.ref_name }}",
"body": "## Changes\n\n${{ steps.notes.outputs.changelog }}",
"draft": true,
"prerelease": false
}'