Skip to content

Commit

Permalink
sync tags to subrepos (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
dixudx authored Oct 12, 2021
1 parent 21040c6 commit d6b7669
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/sync-with-upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,26 @@ jobs:
uses: actions/checkout@v2
with:
repository: clusternet/clusternet
ref: ${{ github.event.client_payload.ref }}
fetch-depth: 0
- name: Update changes
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git subtree split -P pkg/apis -b subrepo-apis
git init ../tmp-apis
git remote add tmp-apis ../tmp-apis
git push -u tmp-apis subrepo-apis:main
cd ../tmp-apis
git checkout main
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
force: true
tags: true
directory: ../tmp-apis
git remote add origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/clusternet/apis.git"
GITHUB_REF=${{ github.event.client_payload.ref }}
if [[ $GITHUB_REF == refs/tags/* ]]
then
TAG=${GITHUB_REF/refs\/tags\//}
git tag $TAG
git push --tags origin $TAG
else
git push origin main
fi

0 comments on commit d6b7669

Please sign in to comment.