name: 'Generate RPM %changelog entry' description: > Collect commits since the previous release tag and prepend a properly-formatted %changelog entry to an rpm spec file. Keeps the changelog in sync with git history automatically on every release, avoiding stale dates and forgotten bumps. author: 'helexa' branding: icon: file-text color: blue inputs: spec: description: 'Path to the rpm spec file to update.' required: true version: description: > Version string for the new entry (without release suffix). Typically derived from the git tag, e.g. "0.1.10". required: true release: description: 'Release suffix to append after the version.' required: false default: '1' author: description: > Name and email for the changelog entry, formatted as "Name ". required: false default: 'Gitea Actions ' tag-pattern: description: > Glob pattern for release tags, used to locate the previous release. Default matches the conventional "v*" scheme. required: false default: 'v*' exclude-patterns: description: > Newline-separated list of grep -E patterns (anchored on the bullet "- " prefix) to drop from the generated log. Defaults filter out bump-version bot commits and merge commits. required: false default: | ^- chore: bump version ^- Merge runs: using: composite steps: - name: Generate changelog entry shell: bash env: SPEC: ${{ inputs.spec }} VERSION: ${{ inputs.version }} RELEASE: ${{ inputs.release }} CHANGELOG_AUTHOR: ${{ inputs.author }} TAG_PATTERN: ${{ inputs.tag-pattern }} EXCLUDE_PATTERNS: ${{ inputs.exclude-patterns }} run: | bash "${{ github.action_path }}/scripts/generate-rpm-changelog.sh" \ "$SPEC" "$VERSION"