-
Notifications
You must be signed in to change notification settings - Fork 0
Dev #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev #51
Changes from all commits
1aefd4b
e073ec0
f3e32ab
c87dd6c
9fc7085
467cf7b
16e3d2e
f11d981
e2ec281
2bc19cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| name: Auto Tag Desktop Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "apps/desktop/src-tauri/tauri.conf.json" | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| auto-tag: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Get version from tauri.conf.json | ||
| id: version | ||
| run: | | ||
| VERSION=$(jq -r '.version' apps/desktop/src-tauri/tauri.conf.json) | ||
| if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then | ||
| echo "::error::No version found in tauri.conf.json" | ||
| exit 1 | ||
| fi | ||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
| echo "tag=v$VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| - name: Check if tag already exists | ||
| id: check | ||
| run: | | ||
| if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then | ||
| echo "exists=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "exists=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Create and push tag | ||
| if: steps.check.outputs.exists == 'false' | ||
| run: | | ||
| git tag "${{ steps.version.outputs.tag }}" | ||
| git push origin "${{ steps.version.outputs.tag }}" | ||
|
Comment on lines
+32
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make tag check/push remote-aware and idempotent. Lines 31–41 use a local 🛠️ Suggested reliability fix - name: Check if tag already exists
id: check
run: |
- if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
+ TAG="${{ steps.version.outputs.tag }}"
+ if git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Create and push tag
if: steps.check.outputs.exists == 'false'
run: |
- git tag "${{ steps.version.outputs.tag }}"
- git push origin "${{ steps.version.outputs.tag }}"
+ TAG="${{ steps.version.outputs.tag }}"
+ git tag "${TAG}"
+ if ! git push origin "refs/tags/${TAG}"; then
+ # If another run won the race, treat as success.
+ git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1
+ fi🤖 Prompt for AI Agents |
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: BuckyMcYolo/townhall
Length of output: 230
🏁 Script executed:
Repository: BuckyMcYolo/townhall
Length of output: 250
🏁 Script executed:
Repository: BuckyMcYolo/townhall
Length of output: 907
🏁 Script executed:
Repository: BuckyMcYolo/townhall
Length of output: 258
Pin GitHub Action to a full commit SHA.
Line 17 uses a mutable ref (
actions/checkout@v4) in a workflow with write permissions. Pin to a full SHA to reduce supply-chain risk.🔒 Suggested change
🤖 Prompt for AI Agents