Skip to content

Commit 96e924f

Browse files
Merge pull request #86 from vue-pivottable/feat/ci
ci: update release workflows
2 parents 2e74538 + 241fd5e commit 96e924f

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

.github/workflows/sync-vue-pivottable.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,41 @@ on:
88
jobs:
99
sync-release:
1010
runs-on: ubuntu-latest
11+
1112
steps:
1213
- name: Checkout
1314
uses: actions/checkout@v3
1415
with:
1516
fetch-depth: 0
1617

17-
- name: Update release branch
18+
- name: Generate GitHub App Token
19+
id: generate-token
20+
uses: tibdex/github-app-token@v1
21+
with:
22+
app_id: ${{ secrets.APP_ID }}
23+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
24+
installation_id: ${{ secrets.APP_INSTALLATION_ID }}
25+
26+
- name: Sync release branch with main
1827
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
2029
run: |
21-
git config --global user.name "GitHub Actions"
22-
git config --global user.email "[email protected]"
30+
git config --global user.name "GitHub App"
31+
git config --global user.email "[email protected]"
32+
33+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
2334
24-
# release 브랜치가 존재하는지 확인
25-
if git ls-remote --exit-code --heads origin release; then
26-
# 존재하면 업데이트
27-
git fetch origin release
35+
git fetch origin
36+
37+
if git show-ref --quiet refs/remotes/origin/release; then
2838
git checkout release
2939
git merge --no-edit origin/main
3040
else
31-
# 존재하지 않으면 생성
32-
git checkout -b release
41+
git checkout -b release origin/main
3342
fi
3443
35-
git push origin release
44+
if git diff --quiet origin/release; then
45+
echo "No changes to push."
46+
else
47+
git push origin release
48+
fi

.releaserc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"branches": ["main"],
2+
"branches": ["release"],
33
"tagFormat": "vue-pivottable@${version}",
44
"plugins": [
55
[

0 commit comments

Comments
 (0)