Skip to content

Commit 2d98a70

Browse files
committedMar 8, 2025·
add github action
1 parent cd6378f commit 2d98a70

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
 

‎.cnb.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ main:
77
settings:
88
target_url: https://github.com/opsre/JenkinsGuide.git
99
auth_type: https
10+
git_email: 'github-actions[bot]@users.noreply.github.com'
1011
username: ${GIT_USERNAME}
1112
password: ${GIT_ACCESS_TOKEN}
1213
branch: main

‎.github/workflows/sync-to-cnb.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Sync to CNB
2+
3+
on: [push]
4+
5+
jobs:
6+
sync:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
with:
11+
fetch-depth: 0
12+
13+
- name: Sync to CNB Repository
14+
run: |
15+
docker run --rm \
16+
-v ${{ github.workspace }}:${{ github.workspace }} \
17+
-w ${{ github.workspace }} \
18+
-e PLUGIN_TARGET_URL="https://cnb.cool/opsre/JenkinsGuide.git" \
19+
-e PLUGIN_AUTH_TYPE="https" \
20+
-e PLUGIN_USERNAME="cnb" \
21+
-e PLUGIN_PASSWORD=${{ secrets.GIT_PASSWORD }} \
22+
-e PLUGIN_BRANCH="main" \
23+
-e PLUGIN_GIT_USER="cnb" \
24+
-e PLUGIN_GIT_EMAIL="cnb@cnb.cool" \
25+
-e PLUGIN_FORCE="true" \
26+
tencentcom/git-sync

0 commit comments

Comments
 (0)
Please sign in to comment.