Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ jobs:
name: accordion-hero-slider-PR-${{ github.event.pull_request.number }}
path: releases/*.zip

- name: Create Release (Tag Only)
if: startsWith(github.ref, 'refs/tags/v')
- name: Create Release
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The condition now allows creating releases on pushes to the main branch, which will attempt to create a release every time code is pushed to main. However, when pushing to main (non-tag push), the workflow will try to create a release with an auto-generated tag name, but if that tag already exists from a previous push, this will fail. Additionally, this can result in unintended releases being created for every commit to main rather than only for tagged versions.

Consider whether releases should truly be created on every push to main, or if releases should only be created when tags are pushed. If the intent is to create releases only for tags, the original condition 'startsWith(github.ref, 'refs/tags/v')' was more appropriate.

Copilot uses AI. Check for mistakes.
uses: softprops/action-gh-release@v2
with:
files: releases/accordion-hero-slider-v${{ env.VERSION }}.zip
body: "Official release version ${{ env.VERSION }}"
tag_name: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || format('v{0}', env.VERSION) }}
name: Release ${{ env.VERSION }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading