forked from autowarefoundation/autoware_launch
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.5 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Update Other Repo with Commit ID (using yq)
on:
workflow_dispatch: # 手動実行トリガー
push:
branches:
- 'features/*'
jobs:
update_other_repo:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Commit ID
id: get_commit_id
run: |
COMMIT_ID=$(git rev-parse HEAD)
echo "COMMIT_ID=$COMMIT_ID" >> $GITHUB_OUTPUT
- name: Checkout Other Repository
uses: actions/checkout@v3
with:
repository: katsuwoo/autoware
path: another-repo
token: ${{ secrets.GH_PAT }}
ref: features/hoge
- name: yq
uses: mikefarah/yq@master
with:
cmd: yq e '.repositories."launcher/autoware_launch".version = "${{ steps.get_commit_id.outputs.COMMIT_ID }}"' -i another-repo/autoware.repos
- name: Configure Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
working-directory: another-repo
- name: Commit Changes
run: |
git add .
git commit -m "Update with commit ID: ${{ steps.get_commit_id.outputs.COMMIT_ID }}"
working-directory: another-repo
- name: Push Changes
run: |
git push origin HEAD:features/hoge
working-directory: another-repo
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}