-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add GitHub Actions workflows for repo syncing and release mana…
…gement
- Loading branch information
1 parent
db64a39
commit 92fdd97
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# @format | ||
|
||
name: Sync Repos | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# You can add more triggers, such as scheduled events | ||
# schedule: | ||
# - cron: '0 0 * * *' | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout source repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Push to destination repository | ||
run: | | ||
git config --global user.email "$GIT_EMAIL" | ||
git config --global user.name "$GIT_USERNAME" | ||
git clone https://${{ env.ORG_NAME }}:${{ secrets.PAT }}@github.com/${{ env.ORG_NAME }}/${{ env.ORIGINAL_REPO_NAME }}.git | ||
cd ${{ env.ORIGINAL_REPO_NAME }} | ||
git remote add ${{ env.ORIGINAL_REPO_NAME }} https://${{ env.GIT_USERNAME }}:${{ secrets.PAT }}@github.com/${{ env.GIT_USERNAME }}/${{ env.ORIGINAL_REPO_NAME }}.git | ||
git remote update | ||
git merge ${{ env.ORIGINAL_REPO_NAME }}/main --allow-unrelated-histories | ||
git push origin main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
ORIGINAL_REPO_NAME: ${{ github.event.repository.name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Release | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
|
||
- run: npx changelogithub | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |