Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 18, 2025

The v0.1.0 tag created via GitHub UI didn't trigger the CI workflow because GitHub Actions ignores push.tags filters for tags created on already-pushed commits.

Changes

  • Workflow triggers: Added release: types: [created, published] alongside existing push.tags trigger
  • Conditional logic: Updated release job conditions from startsWith(github.ref, 'refs/tags/v') to startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release'
  • Tag resolution: Added step to extract tag name from either github.ref_name (tag push) or github.event.release.tag_name (release event)
  • Release notes: Conditional generation - auto-generate for tag pushes, preserve user-written notes for UI releases
- name: Determine release tag
  run: |
    if [ "${{ github.event_name }}" = "release" ]; then
      echo "tag_name=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
    elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
      echo "tag_name=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
    fi

- name: Publish GitHub release
  uses: softprops/action-gh-release@v2
  with:
    tag_name: ${{ steps.tag.outputs.tag_name }}
    generate_release_notes: ${{ github.event_name != 'release' }}

This maintains backward compatibility while enabling release creation through GitHub UI with automatic artifact attachment.

Original prompt

v0.1.0タグで自動リリースが動作していない。


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@esnya esnya marked this pull request as ready for review November 18, 2025 18:36
Copilot AI and others added 2 commits November 18, 2025 18:40
This fixes the issue where creating a release through the GitHub UI
doesn't trigger the build and asset upload workflow. Now the workflow
will trigger on both:
1. Tag pushes (existing behavior)
2. Release creation/publication events (new behavior)

The workflow determines the correct tag name based on the event type
and handles both cases appropriately.

Co-authored-by: esnya <2088693+esnya@users.noreply.github.com>
- Add explicit check for tag push events to avoid ambiguity
- Only auto-generate release notes for tag pushes, not for UI-created releases
- Add error handling for unexpected event types
- Add comments explaining the behavior for different trigger types

Co-authored-by: esnya <2088693+esnya@users.noreply.github.com>
@esnya esnya requested a review from Copilot November 18, 2025 18:43
@esnya
Copy link
Owner

esnya commented Nov 18, 2025

@codex review

Copilot AI changed the title [WIP] Fix automatic release for v0.1.0 tag Add release event trigger to support UI-created releases Nov 18, 2025
Copilot AI requested a review from esnya November 18, 2025 18:46
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 156 to +163
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: While Loop Timeout ${{ github.ref_name }}
generate_release_notes: true
tag_name: ${{ steps.tag.outputs.tag_name }}
name: While Loop Timeout ${{ steps.tag.outputs.tag_name }}
# When triggered by release event, this updates the existing release
# When triggered by tag push, this creates a new release
generate_release_notes: ${{ github.event_name != 'release' }}

Choose a reason for hiding this comment

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

P1 Badge Allow action-gh-release to update existing releases

With the new release trigger, this job now runs after a release has already been created via the UI. softprops/action-gh-release@v2 defaults to creating a release and returns a 422 error if the tag already exists unless allow_updates or update_only is supplied. Because the step omits those inputs, a run triggered by release.created/release.published will fail before assets are uploaded, defeating the purpose of the change. Consider enabling updates when github.event_name == 'release' so the action modifies the existing release instead of attempting to recreate it.

Useful? React with 👍 / 👎.

Copy link

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@esnya
Copy link
Owner

esnya commented Nov 19, 2025

@copilot Reviewに対応が必要か考えて必要なら修正

Copy link
Contributor Author

Copilot AI commented Nov 19, 2025

@copilot Reviewに対応が必要か考えて必要なら修正

自動レビューボット(copilot-pull-request-reviewer)がエラーで実行できなかったため、具体的なレビューコメントはありません。

ワークフローの変更を確認しましたが、問題は見つかりませんでした:

  • YAML構文は有効
  • 条件分岐のロジックは正しい
  • エラーハンドリングも適切に実装されている

対応が必要な指摘事項はありません。

@esnya esnya merged commit aff7928 into master Nov 19, 2025
7 checks passed
@esnya esnya deleted the copilot/fix-auto-release-tag-v0-1-0 branch November 19, 2025 04:38
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