Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions .github/workflows/sync-vue-pivottable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,41 @@ on:
jobs:
sync-release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Update release branch
- name: Generate GitHub App Token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: ${{ secrets.APP_INSTALLATION_ID }}

- name: Sync release branch with main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git config --global user.name "GitHub App"
git config --global user.email "github-app@example.com"

git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git

# release 브랜치가 존재하는지 확인
if git ls-remote --exit-code --heads origin release; then
# 존재하면 업데이트
git fetch origin release
git fetch origin

if git show-ref --quiet refs/remotes/origin/release; then
git checkout release
git merge --no-edit origin/main
else
# 존재하지 않으면 생성
git checkout -b release
git checkout -b release origin/main
fi

git push origin release
if git diff --quiet origin/release; then
echo "No changes to push."
else
git push origin release
fi
2 changes: 1 addition & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"branches": ["main"],
"branches": ["release"],
"tagFormat": "vue-pivottable@${version}",
"plugins": [
[
Expand Down