Skip to content

feat: Enhance release notes generation with optional tag input and workflow adjustments#62

Merged
duartebarbosadev merged 3 commits intomainfrom
ci/release-build-call-release-notes
Nov 16, 2025
Merged

feat: Enhance release notes generation with optional tag input and workflow adjustments#62
duartebarbosadev merged 3 commits intomainfrom
ci/release-build-call-release-notes

Conversation

@duartebarbosadev
Copy link
Copy Markdown
Owner

This pull request updates the release workflow to automate and streamline the generation of release notes. The main changes involve integrating the release notes generation workflow into the main release pipeline and enhancing its flexibility to handle different triggering scenarios.

Release workflow integration and improvements:

  • Added a new release-notes job to .github/workflows/release-build.yml that runs after the main release job and calls the release notes generator workflow, passing the release tag and inheriting secrets.

Release notes workflow enhancements:

  • Updated .github/workflows/release-notes-generator.yml to support invocation via workflow_call, allowing the workflow to be triggered from other workflows and to accept an optional tag input.
  • Improved logic for determining the release tag in the release notes generator workflow: now prioritizes the provided input, falls back to the release event's tag, and finally to the most recent tag when triggered manually.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request integrates automated release notes generation into the release pipeline by adding workflow_call support to the release notes generator and invoking it from the main release workflow.

Key changes:

  • Added workflow_call trigger with optional tag input parameter to the release notes generator workflow
  • Enhanced tag determination logic to prioritize input parameter, then fall back to release event or most recent tag
  • Integrated release notes generation as a dependent job in the release build workflow

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/release-notes-generator.yml Added workflow_call trigger with optional tag input, removed released event type, refactored tag determination logic to support multiple trigger scenarios
.github/workflows/release-build.yml Added new release-notes job that calls the release notes generator workflow after successful release, passing the tag and inheriting secrets

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 50 to 57
TAG_NAME="${{ inputs.tag }}"
if [[ -z "${TAG_NAME}" && "${{ github.event_name }}" == "release" ]]; then
TAG_NAME="${{ github.event.release.tag_name }}"
else
# workflow_dispatch - use most recent tag by creation date
fi

if [[ -z "${TAG_NAME}" && "${{ github.event_name }}" == "workflow_dispatch" ]]; then
TAG_NAME="$(git tag --sort=-creatordate | head -n 1 || true)"
fi
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tag determination logic doesn't handle the workflow_call event properly. When triggered via workflow_call, the github.event_name will be "workflow_call", not "release" or "workflow_dispatch". If no tag input is provided (which is allowed since required: false), both conditions on lines 51 and 55 will be false, causing the workflow to exit with an error on line 61.

Consider adding a fallback for the workflow_call case:

if [[ -z "${TAG_NAME}" ]]; then
  # Fallback to most recent tag for workflow_call or other triggers
  TAG_NAME="$(git tag --sort=-creatordate | head -n 1 || true)"
fi

This would make the workflow more robust, even though the current caller always provides a tag.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release-notes:
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release-notes job will run even when the release job is skipped due to the condition if: startsWith(github.ref, 'refs/tags/'). When triggered by workflow_dispatch without a tag (where github.ref would be a branch), the release job will be skipped, but release-notes will still attempt to run and call the release-notes-generator workflow.

Consider adding the same condition to the release-notes job:

release-notes:
  if: startsWith(github.ref, 'refs/tags/')
  needs: release
  uses: ./.github/workflows/release-notes-generator.yml
  with:
    tag: ${{ github.ref_name }}
  secrets: inherit
Suggested change
release-notes:
release-notes:
if: startsWith(github.ref, 'refs/tags/')

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +59
if [[ -z "${TAG_NAME}" && "${{ github.event_name }}" == "workflow_dispatch" ]]; then
TAG_NAME="$(git tag --sort=-creatordate | head -n 1 || true)"
fi

# Fallback for workflow_call or any other trigger if tag was not provided/resolved
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic has redundancy that could be simplified. Lines 55-57 and 60-62 have identical fallback logic. The condition on line 55 will never be true when line 60 is reached because if TAG_NAME is empty and the event is workflow_dispatch, it will be set on line 56, making the second fallback unreachable for that specific case.

Consider simplifying to:

TAG_NAME="${{ inputs.tag }}"
if [[ -z "${TAG_NAME}" && "${{ github.event_name }}" == "release" ]]; then
  TAG_NAME="${{ github.event.release.tag_name }}"
fi

# Fallback to most recent tag for workflow_dispatch, workflow_call, or if tag not provided/resolved
if [[ -z "${TAG_NAME}" ]]; then
  TAG_NAME="$(git tag --sort=-creatordate | head -n 1 || true)"
fi
Suggested change
if [[ -z "${TAG_NAME}" && "${{ github.event_name }}" == "workflow_dispatch" ]]; then
TAG_NAME="$(git tag --sort=-creatordate | head -n 1 || true)"
fi
# Fallback for workflow_call or any other trigger if tag was not provided/resolved
# Fallback to most recent tag for workflow_dispatch, workflow_call, or if tag not provided/resolved

Copilot uses AI. Check for mistakes.
workflow_dispatch:
workflow_call:
inputs:
tag:
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The tag input is missing a description field. While not strictly required, adding a description improves workflow documentation and helps users understand the input's purpose.

Consider adding:

workflow_call:
  inputs:
    tag:
      description: 'Release tag to generate notes for. If not provided, uses the release event tag or the most recent tag.'
      required: false
      type: string
Suggested change
tag:
tag:
description: 'Release tag to generate notes for. If not provided, uses the release event tag or the most recent tag.'

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@duartebarbosadev duartebarbosadev merged commit 68d4dbb into main Nov 16, 2025
9 checks passed
@duartebarbosadev duartebarbosadev deleted the ci/release-build-call-release-notes branch November 16, 2025 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants