Skip to content

Commit 20ead7e

Browse files
committed
oelint-adv.yml: add merge_group trigger
1. Add merge_group trigger 2. Use environment variables for security 3. Handle both pull_request and merge_group base SHA detection 4. Update to modern >> $GITHUB_OUTPUT syntax (replacing deprecated ::set-output) (cherry picked from commit 991e3e4)
1 parent c384eb0 commit 20ead7e

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

.github/workflows/oelint-adv.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,42 @@ on:
44
pull_request:
55
branches:
66
- '*-next'
7+
merge_group:
78

89
jobs:
910
oelint-adv:
1011
runs-on: ubuntu-22.04
11-
12+
1213
steps:
1314
- name: install required packages to run oelint_adv
14-
run: |
15+
run: |
1516
sudo apt-get -y install python3-pip
1617
sudo pip3 install oelint_adv
17-
18+
1819
- name: checkout meta-aws branch to test
1920
uses: actions/checkout@v3
2021
with:
2122
fetch-depth: 0
22-
23+
2324
- name: get changed bb files
24-
id: changes
25-
run: |
26-
echo "::set-output name=bb::$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep .bb | xargs)"
27-
28-
- name: run oelint_adv
25+
id: changes
26+
env:
27+
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
28+
MERGE_GROUP_BASE_SHA: ${{ github.event.merge_group.base_sha }}
29+
HEAD_SHA: ${{ github.sha }}
30+
run: |
31+
if [ -n "$PR_BASE_SHA" ]; then
32+
BASE_SHA="$PR_BASE_SHA"
33+
elif [ -n "$MERGE_GROUP_BASE_SHA" ]; then
34+
BASE_SHA="$MERGE_GROUP_BASE_SHA"
35+
else
36+
echo "No base SHA found"
37+
exit 1
38+
fi
39+
BB_FILES=$(git diff --name-only --diff-filter=ACMRT "$BASE_SHA" "$HEAD_SHA" | grep .bb | xargs)
40+
echo "bb=$BB_FILES" >> $GITHUB_OUTPUT
41+
42+
- name: run oelint_adv
2943
if: ${{steps.changes.outputs.bb}}
3044
run: |
3145
oelint-adv --nowarn --noinfo ${{steps.changes.outputs.bb}} --release scarthgap

0 commit comments

Comments
 (0)