Skip to content

Commit b5e0125

Browse files
committed
chore: Update AI-policy workflow
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
1 parent 0e5c0ef commit b5e0125

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

.github/workflows/ai-policy.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,16 @@ concurrency:
2727

2828
jobs:
2929
check-ai-trailers:
30-
runs-on: ubuntu-latest
30+
runs-on: ubuntu-latest-low
3131
steps:
32-
- name: Checkout
33-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
34-
with:
35-
fetch-depth: 0
36-
persist-credentials: false
37-
3832
- name: Collect PR commit messages
3933
id: collect
4034
env:
41-
BASE_REF: ${{ github.base_ref }}
35+
GH_TOKEN: ${{ github.token }}
36+
COMMITS_URL: ${{ github.event.pull_request.commits_url }}
4237
run: |
4338
set -euo pipefail
44-
git fetch origin "${BASE_REF}"
45-
MERGE_BASE=$(git merge-base "origin/${BASE_REF}" HEAD)
46-
git log --format="%B" "${MERGE_BASE}..HEAD" > /tmp/pr_commits.txt
39+
gh api ${COMMITS_URL} | jq -r '.[] | .commit.message' > /tmp/pr_commits.txt
4740
echo "--- PR commit messages ---"
4841
cat /tmp/pr_commits.txt
4942
echo "--------------------------"
@@ -83,10 +76,10 @@ jobs:
8376
run: |
8477
set -euo pipefail
8578
AI_ASSISTED=false
86-
if grep -qiE '^(AI-assistant|Assisted-by):' /tmp/pr_commits.txt; then
79+
if grep -qiE '^(AI-assistant|Assisted-by|AI-Assisted-By):' /tmp/pr_commits.txt; then
8780
AI_ASSISTED=true
88-
echo "Found AI-assistant/Assisted-by trailer(s):"
89-
grep -iE '^(AI-assistant|Assisted-by):' /tmp/pr_commits.txt
81+
echo "Found AI-assistant/Assisted-by/AI-Assisted-By trailer(s):"
82+
grep -iE '^(AI-assistant|Assisted-by|AI-Assisted-By):' /tmp/pr_commits.txt
9083
fi
9184
echo "ai_assisted=${AI_ASSISTED}" >> "$GITHUB_OUTPUT"
9285

0 commit comments

Comments
 (0)