From 952c3d0261e6fa40e7bd35dc060b567b2806d2cd Mon Sep 17 00:00:00 2001 From: Joyce Brum Date: Wed, 13 Nov 2024 17:25:37 +0000 Subject: [PATCH] Fix: GitHub workflow script injection Signed-off-by: Joyce Brum --- .github/workflows/apidiff.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/apidiff.yaml b/.github/workflows/apidiff.yaml index 0e29f4797..d587dfcbf 100644 --- a/.github/workflows/apidiff.yaml +++ b/.github/workflows/apidiff.yaml @@ -3,6 +3,9 @@ name: apidiff on: pull_request: +env: + PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} + jobs: scan_changes: runs-on: ubuntu-latest @@ -76,7 +79,7 @@ jobs: # non-breaking. run: | cd ${{ matrix.changed }} && apidiff -m -incompatible ${{ steps.baseline.outputs.pkg }} . > diff.txt - if [[ ${{ github.event.pull_request.head.ref }} == owl-bot-copy ]]; then + if [[ $PR_HEAD_REF == owl-bot-copy ]]; then sed -i '/: added/d' ./diff.txt fi cat diff.txt && ! [ -s diff.txt ]