Skip to content

Commit ed4e6d1

Browse files
Changqing-JINGatc-github
authored andcommitted
Fix tag is not correctly synced to github (#690)
1 parent aa40607 commit ed4e6d1

File tree

5 files changed

+63
-33
lines changed

5 files changed

+63
-33
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: sync branches to github
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- develop
9+
- "release/*"
10+
workflow_dispatch:
11+
12+
jobs:
13+
sync-branches:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- run: |
18+
set -e
19+
git remote add github https://${{ secrets.OSS_GITHUB_NAME }}:${{ secrets.OSS_GITHUB_TOKEN }}@github.com/wasm-ecosystem/wasm-compiler.git
20+
21+
# Push the current branch
22+
BRANCH_NAME=${GITHUB_REF#refs/heads/}
23+
git push github "$BRANCH_NAME" -f
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: sync tags to github
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch:
8+
inputs:
9+
tag_name:
10+
description: "Tag name to sync"
11+
required: false
12+
type: string
13+
14+
jobs:
15+
sync-tag:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- run: |
22+
set -e
23+
git remote add github https://${{ secrets.OSS_GITHUB_NAME }}:${{ secrets.OSS_GITHUB_TOKEN }}@github.com/wasm-ecosystem/wasm-compiler.git
24+
25+
# Determine tag name: from manual input or from push event
26+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
27+
TAG_NAME="${{ github.event.inputs.tag_name }}"
28+
else
29+
# It's a tag push event
30+
TAG_NAME="${GITHUB_REF#refs/tags/}"
31+
fi
32+
33+
echo "Syncing tag: $TAG_NAME"
34+
git push github "$TAG_NAME"

.github/workflows/github-sync.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88

99
env:
1010
package_name: wasm-compiler-${{ github.ref_name }}.tar.gz
11+
12+
permissions:
13+
contents: write
14+
1115
jobs:
1216
release:
1317
runs-on: [ubuntu-latest]

.github/workflows/tag.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616
with:
17-
fetch-depth: -1
17+
token: ${{ secrets.TECH_USER_ATC_GITHUB_TOKEN }}
18+
fetch-depth: 0
1819
- name: Configure git for release tagging
1920
run: |
2021
git config --global user.email "[email protected]"

0 commit comments

Comments
 (0)