Browse Source

chore: improve auto-tag workflow with enhanced output verification and debugging

- Updated the output redirection for the generated version to use quotes for better compatibility.
- Enhanced debug output to provide clearer visibility into step and job outputs, aiding in troubleshooting.
- Added a verification step to display the contents of GITHUB_OUTPUT, ensuring the version value is correctly set before proceeding to the release job.
- Refined the conditional execution for the release job to ensure it runs only when the auto-tag job succeeds and a version is generated.
pull/122/head v0.0.15
煎饼果子卷鲨鱼辣椒 5 months ago
parent
commit
deb1aafcb5
  1. 25
      .github/workflows/auto-tag.yml

25
.github/workflows/auto-tag.yml

@ -37,7 +37,7 @@ jobs:
new_patch=$((patch + 1)) new_patch=$((patch + 1))
new_version="$major.$minor.$new_patch" new_version="$major.$minor.$new_patch"
fi fi
echo "version=$new_version" >> $GITHUB_OUTPUT
echo "version=$new_version" >> "$GITHUB_OUTPUT"
echo "Generated version: $new_version" echo "Generated version: $new_version"
- name: Validate version - name: Validate version
@ -62,13 +62,28 @@ jobs:
- name: Debug output - name: Debug output
run: | run: |
echo "Version output: ${{ steps.get_latest_tag.outputs.version }}"
echo "Job outputs: ${{ toJSON(needs.auto-tag.outputs) }}"
echo "::debug::Version value: ${{ steps.get_latest_tag.outputs.version }}"
echo "Step outputs:"
echo " version: ${{ steps.get_latest_tag.outputs.version }}"
echo "Job outputs:"
echo " all: ${{ toJSON(job.outputs) }}"
echo " direct: ${{ job.outputs.version }}"
echo "Needs outputs:"
echo " all: ${{ toJSON(needs) }}"
echo "::debug::Raw version value: ${{ steps.get_latest_tag.outputs.version }}"
- name: Verify outputs
run: |
echo "GITHUB_OUTPUT contents:"
cat $GITHUB_OUTPUT
echo "---"
echo "Direct version value: ${{ steps.get_latest_tag.outputs.version }}"
release: release:
needs: auto-tag needs: auto-tag
if: success() && needs.auto-tag.outputs.version != ''
if: |
always() &&
needs.auto-tag.result == 'success' &&
needs.auto-tag.outputs.version != ''
uses: ./.github/workflows/release.yml uses: ./.github/workflows/release.yml
with: with:
version: ${{ needs.auto-tag.outputs.version }} version: ${{ needs.auto-tag.outputs.version }}

Loading…
Cancel
Save