Skip to content

Commit aa6bcbb

Browse files
OldManYellsAtCloudotavio
authored andcommitted
firefox: enable pull_request trigger for github workflow
Beside the manual trigger, also enable the pull requets trigger. Differentiate between the manual and PR triggering when determining the URLs and branches to be able to use both kind of triggers. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
1 parent 4c0b62f commit aa6bcbb

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/yocto_matrix.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
description: 'Branch to checkout for the workflow'
1212
required: true
1313
default: 'master'
14+
pull_request:
15+
branches:
16+
- master
17+
paths:
18+
- 'meta-firefox/**'
1419

1520
permissions:
1621
contents: read
@@ -40,8 +45,15 @@ jobs:
4045
mkdir -p /yocto/${{ matrix.yocto_version }}
4146
cd /yocto/${{ matrix.yocto_version }}
4247
rm -rf meta-browser meta-firefox-test
43-
git clone $GITHUB_SERVER_URL/${{ github.event.inputs.repository }}/meta-browser
44-
git -C meta-browser checkout ${{ github.event.inputs.branch }}
48+
if [ "${{ github.event_name }}" = "pull_request" ]; then
49+
GH_URL="$GITHUB_SERVER_URL/${{ github.event.pull_request.head.repo.full_name }}"
50+
GH_REV="$GITHUB_HEAD_REF"
51+
else
52+
GH_URL="$GITHUB_SERVER_URL/${{ github.event.inputs.repository }}/meta-browser"
53+
GH_REV="${{ github.event.inputs.branch }}"
54+
fi
55+
git clone $GH_URL
56+
git -C meta-browser checkout $GH_REV
4557
# clone the test repo
4658
git clone https://github.com/OldManYellsAtCloud/meta-firefox-test.git
4759
./meta-firefox-test/scripts/build.sh ${{ matrix.yocto_version}} ${{ matrix.arch }} ${{ matrix.ff_version }} ${{ matrix.libc_flavour}}

0 commit comments

Comments
 (0)