perf(syncservice,certd): add pipeline id support for certificate appl… #30
This file contains hidden or 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
| name: 同步代码到 AtomGit | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "**" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| env: | |
| ATOMGIT_REPOSITORY: ${{ vars.ATOMGIT_REPOSITORY || 'certd/certd-client' }} | |
| ATOMGIT_TOKEN: ${{ secrets.ATOMGIT_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| - name: 同步全部分支和标签 | |
| shell: bash | |
| run: | | |
| if [ -z "$ATOMGIT_TOKEN" ]; then | |
| echo "缺少 ATOMGIT_TOKEN Secret" >&2 | |
| exit 1 | |
| fi | |
| git fetch origin '+refs/heads/*:refs/remotes/origin/*' '+refs/tags/*:refs/tags/*' | |
| git remote add atomgit "https://oauth2:${ATOMGIT_TOKEN}@atomgit.com/${ATOMGIT_REPOSITORY}.git" | |
| git push --force atomgit 'refs/remotes/origin/*:refs/heads/*' | |
| git push --force atomgit --tags |