Skip to content

Commit ef5a227

Browse files
authored
fix release tagging (#312)
1 parent a8c03d4 commit ef5a227

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/create_miner_build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ jobs:
268268
run: |
269269
TAG="${{ steps.get_version.outputs.tag }}"
270270
echo "Tag to create: $TAG"
271+
272+
# Explicitly update remote with token to ensure correct authentication
273+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
274+
271275
if git ls-remote --tags origin "$TAG" | grep -q "$TAG"; then
272276
echo "Tag $TAG already exists on remote, skipping tag creation."
273277
else

.github/workflows/test_tagging.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test Tag Creation
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
test-tagging:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
with:
12+
token: ${{ secrets.PAT_TOKEN }}
13+
14+
- name: Test Tag Creation and Push
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
17+
run: |
18+
# Create a temporary test tag
19+
TAG="test-tag-v$(date +%s)"
20+
echo "Attempting to create and push tag: $TAG"
21+
22+
git config user.name "github-actions[bot]"
23+
git config user.email "github-actions[bot]@users.noreply.github.com"
24+
25+
# Explicitly update remote with token to ensure correct authentication
26+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
27+
28+
git tag "$TAG"
29+
30+
echo "Pushing tag..."
31+
git push origin "$TAG"
32+
33+
echo "Tag pushed successfully. Cleaning up..."
34+
git push --delete origin "$TAG"
35+
echo "Cleanup complete."
36+

0 commit comments

Comments
 (0)