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
12 changes: 10 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
runs-on: ubuntu-latest
outputs:
current_version: ${{ steps.package-version.outputs.version }}
tag_name: v${{ steps.package-version.outputs.version }}
tag_name: ${{ steps.package-version.outputs.tag_name }}
draft: "false"
prerelease: ${{ github.ref_type != 'tag' && 'true' || 'false' }}
body: |
See the assets to download this version and install.
name: ObsidianIRC v${{ steps.package-version.outputs.version }}
name: ObsidianIRC ${{ steps.package-version.outputs.tag_name }}
steps:
- uses: actions/checkout@v4
- name: Get Node project version
Expand All @@ -33,6 +33,14 @@ jobs:
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

if [ "$GITHUB_REF_TYPE" = "tag" ]; then
echo "tag_name=v$VERSION" >> "$GITHUB_OUTPUT"
Comment on lines +36 to +37
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Use the triggering Git tag directly for tag builds.

For tag-triggered runs, deriving tag_name from package.json can mismatch the pushed tag and publish under the wrong tag/release. Use GITHUB_REF_NAME here.

Suggested fix
-          if [ "$GITHUB_REF_TYPE" = "tag" ]; then
-            echo "tag_name=v$VERSION" >> "$GITHUB_OUTPUT"
+          if [ "$GITHUB_REF_TYPE" = "tag" ]; then
+            echo "tag_name=$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [ "$GITHUB_REF_TYPE" = "tag" ]; then
echo "tag_name=v$VERSION" >> "$GITHUB_OUTPUT"
if [ "$GITHUB_REF_TYPE" = "tag" ]; then
echo "tag_name=$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/publish.yaml around lines 36 - 37, Replace deriving
tag_name from package.json with the actual Git tag that triggered the workflow:
when checking if GITHUB_REF_TYPE equals "tag" (the if block containing the
echo), set tag_name using the GITHUB_REF_NAME environment variable instead of
v$VERSION — i.e. emit tag_name based on $GITHUB_REF_NAME so the publish uses the
exact tag that triggered the run.

else
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
NEXT_PATCH=$((PATCH + 1))
echo "tag_name=v${MAJOR}.${MINOR}.${NEXT_PATCH}-pre" >> "$GITHUB_OUTPUT"
Comment thread
matheusfillipe marked this conversation as resolved.
fi

publish-tauri:
needs: collect-version
permissions:
Expand Down