mirror of
https://github.com/stack-auth/stack.git
synced 2026-07-20 21:29:36 +08:00
Update workflows
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
name: Mirror main branch to main-mirror-for-wdb
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
|
||||
|
||||
jobs:
|
||||
lint_and_build:
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
|
||||
- name: Mirror branch
|
||||
run: |
|
||||
git pull --all
|
||||
git switch -c main-mirror-for-wdb
|
||||
git reset --hard origin/main
|
||||
|
||||
- name: Trigger rebuild
|
||||
run: |
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git commit --allow-empty -m "Trigger Vercel rebuild"
|
||||
|
||||
- name: Push branch
|
||||
run: |
|
||||
git push -f origin main-mirror-for-wdb
|
||||
@@ -16,11 +16,13 @@ concurrency:
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
environment: "hexclave/stack-auth — Publish npm packages"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.NPM_PUBLISH_VERSION_UPDATE_PR_PAT }}
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
name: Sync Main to Dev
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
sync-commits:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Sync main commits to dev
|
||||
run: |
|
||||
# Fetch all branches
|
||||
git fetch origin dev:dev
|
||||
|
||||
# Switch to dev branch
|
||||
git checkout dev
|
||||
|
||||
# Find commits on main that are not on dev
|
||||
COMMITS_TO_CHERRY_PICK=$(git rev-list --reverse main ^dev)
|
||||
|
||||
if [ -z "$COMMITS_TO_CHERRY_PICK" ]; then
|
||||
echo "No commits to sync from main to dev"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Found commits to cherry-pick:"
|
||||
echo "$COMMITS_TO_CHERRY_PICK"
|
||||
|
||||
# Cherry-pick each commit
|
||||
SUCCESS=true
|
||||
for COMMIT in $COMMITS_TO_CHERRY_PICK; do
|
||||
echo "Cherry-picking commit: $COMMIT"
|
||||
if ! git cherry-pick $COMMIT; then
|
||||
echo "Cherry-pick failed for commit $COMMIT"
|
||||
# Try to continue with --allow-empty in case it's already applied
|
||||
if ! git cherry-pick --continue --allow-empty 2>/dev/null; then
|
||||
echo "Failed to cherry-pick $COMMIT, aborting"
|
||||
git cherry-pick --abort
|
||||
SUCCESS=false
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$SUCCESS" = true ]; then
|
||||
# Push changes to dev
|
||||
git push origin dev
|
||||
echo "Successfully synced commits from main to dev"
|
||||
else
|
||||
echo "Failed to sync some commits"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user