forked from autowarefoundation/autoware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sync-public.yaml (autowarefoundation#14)
* Add sync-public.yaml Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp> * Add sync-public-develop.yaml Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
- Loading branch information
1 parent
7e1483d
commit 2e0fab8
Showing
2 changed files
with
80 additions
and
0 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,40 @@ | ||
name: sync public | ||
|
||
on: | ||
schedule: | ||
- cron: "0 19 * * *" # run at 4 AM JST | ||
workflow_dispatch: | ||
|
||
env: | ||
BASE_BRANCH: develop | ||
SYNC_TARGET_BRANCH: develop | ||
SYNC_TARGET_REPOSITORY: https://github.com/tier4/AutowareArchitectureProposal_api_adaptor.git | ||
|
||
jobs: | ||
sync-public: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ env.BASE_BRANCH }} | ||
fetch-depth: 0 | ||
|
||
- name: Generate token | ||
uses: tibdex/github-app-token@v1 | ||
id: generate-token | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: Set git config for private repositories | ||
run: | | ||
git config --local --unset-all http.https://github.com/.extraheader || true | ||
git config --global url.https://x-access-token:${{ steps.generate-token.outputs.token }}@github.com.insteadOf 'https://github.com' | ||
- name: Push to public repository | ||
run: | | ||
git remote add public ${{ env.SYNC_TARGET_REPOSITORY }} | ||
git fetch public | ||
git push public ${{ env.BASE_BRANCH }}:${{ env.SYNC_TARGET_BRANCH }} |
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,40 @@ | ||
name: sync public | ||
|
||
on: | ||
schedule: | ||
- cron: "0 19 * * *" # run at 4 AM JST | ||
workflow_dispatch: | ||
|
||
env: | ||
BASE_BRANCH: main | ||
SYNC_TARGET_BRANCH: main | ||
SYNC_TARGET_REPOSITORY: https://github.com/tier4/AutowareArchitectureProposal_api_adaptor.git | ||
|
||
jobs: | ||
sync-public: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ env.BASE_BRANCH }} | ||
fetch-depth: 0 | ||
|
||
- name: Generate token | ||
uses: tibdex/github-app-token@v1 | ||
id: generate-token | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: Set git config for private repositories | ||
run: | | ||
git config --local --unset-all http.https://github.com/.extraheader || true | ||
git config --global url.https://x-access-token:${{ steps.generate-token.outputs.token }}@github.com.insteadOf 'https://github.com' | ||
- name: Push to public repository | ||
run: | | ||
git remote add public ${{ env.SYNC_TARGET_REPOSITORY }} | ||
git fetch public | ||
git push public ${{ env.BASE_BRANCH }}:${{ env.SYNC_TARGET_BRANCH }} |