-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add new kubernetes version (#2363) Co-authored-by: ks-ci-bot <[email protected]> * Create sync-featrue-code.yaml (#2371) Signed-off-by: joyceliu <[email protected]> * update calico to v3.27.4 (#2383) Signed-off-by: pixiake <[email protected]> --------- Signed-off-by: joyceliu <[email protected]> Signed-off-by: pixiake <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ks-ci-bot <[email protected]> Co-authored-by: pixiake <[email protected]>
- Loading branch information
1 parent
8347277
commit 5cad5b5
Showing
5 changed files
with
100 additions
and
25 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,59 @@ | ||
name: Sync Feature Branch to Main | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # Runs daily at midnight | ||
workflow_dispatch: # Manual trigger | ||
|
||
jobs: | ||
sync-feature: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check if PR has merged | ||
id: check_pr | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
if [[ $(gh pr ls -H sync-feature-to-main -B master -R kubesphere/kubekey) == "" ]]; then | ||
echo "pr_merged=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "pr_merged=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Checkout master branch | ||
if: ${{ steps.check_pr.outputs.pr_merged == 'true' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: master | ||
|
||
- name: Checkout feature branch | ||
if: ${{ steps.check_pr.outputs.pr_merged == 'true' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: feature | ||
path: feature-branch | ||
|
||
- name: Remove old feature directory | ||
if: ${{ steps.check_pr.outputs.pr_merged == 'true' }} | ||
run: rm -rf feature | ||
|
||
- name: Sync feature branch to master/feature directory | ||
if: ${{ steps.check_pr.outputs.pr_merged == 'true' }} | ||
run: | | ||
mkdir -p feature | ||
cp -r feature-branch/* feature/ | ||
git config --global user.name 'ks-ci-bot' | ||
git config --global user.email '[email protected]' | ||
git add feature/ | ||
git commit -m "Sync feature branch to master/feature directory" | ||
- name: Push changes and create PR | ||
if: ${{ steps.check_pr.outputs.pr_merged == 'true' }} | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: Sync feature branch to master/feature directory | ||
branch: sync-feature-to-main | ||
title: [ci-bot] Sync feature branch to master/feature directory | ||
body: This PR syncs the feature branch to the master/feature directory. |
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
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
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
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