Skip to content

Commit a491b25

Browse files
authored
Merge pull request tier4#1608 from HansRobo/fix/release-action-in-fork
Fix errors in Release.yaml with external pull-request
2 parents a9fb6c8 + 7be81df commit a491b25

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/Release.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
new_version: ${{ steps.new_version.outputs.new_version }}
3434
steps:
3535
- name: Restore branch
36+
if: github.event.pull_request.merged == true
3637
uses: levonet/action-restore-branch@master
3738

3839
- name: Install bloom
@@ -42,6 +43,7 @@ jobs:
4243
uses: actions/checkout@v4
4344
with:
4445
ref: master
46+
repository: ${{ github.event.pull_request.base.repo.full_name }}
4547
fetch-depth: 0
4648
fetch-tags: true
4749

@@ -50,16 +52,19 @@ jobs:
5052
git config --global user.name "Release Bot"
5153
git config --global user.email "[email protected]"
5254
git config --global --add safe.directory /__w/scenario_simulator_v2/scenario_simulator_v2
53-
git config --global credential.helper ${{ secrets.BLOOM_GITHUB_TOKEN }}
5455
git config pull.rebase false
5556
57+
- name: Setup git credential
58+
if: github.event.pull_request.merged == true
59+
run: git config --global credential.helper ${{ secrets.BLOOM_GITHUB_TOKEN }}
60+
5661
- name: Get old version
5762
id: old_version
5863
run: |
5964
echo "old_version=$(catkin_package_version)" >> $GITHUB_OUTPUT
6065
61-
- name: Merge branch
62-
run: git pull origin ${{ github.head_ref }}
66+
- name: Pull head branch
67+
run: git pull ${{ github.event.pull_request.head.repo.clone_url }} ${{ github.head_ref }}
6368

6469
- name: Bump patch version
6570
if: (contains(github.event.pull_request.labels.*.name, 'bump patch'))

0 commit comments

Comments
 (0)