Skip to content

Commit 05ae211

Browse files
committed
fix: simplify the condition of merge commit
1 parent 2d80f9a commit 05ae211

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

.github/workflows/sbom.yml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,9 @@ permissions:
1515
contents: write
1616

1717
jobs:
18-
check_merge:
19-
runs-on: ubuntu-latest
20-
outputs:
21-
is_merge: ${{ steps.check_merge_commit.outputs.is_merge }}
22-
steps:
23-
# Check if commit is a merge commit by message
24-
- name: Is merge
25-
id: check_merge_commit
26-
run: |
27-
echo "Commit message: ${{ github.event.head_commit.message }}"
28-
if echo "${{ github.event.head_commit.message }}" | grep "Merge pull request"; then
29-
echo "is_merge=true" >> $GITHUB_OUTPUT
30-
else
31-
echo "is_merge=false" >> $GITHUB_OUTPUT
32-
fi
33-
3418
sbom:
35-
# To execute when "check_merge" finishes
36-
needs: check_merge
37-
# Skip if the job was triggered by the SBOM commit in the latest push.
38-
if: "needs.check_merge.outputs.is_merge != 'true' && !contains(github.event.head_commit.message, 'SBOM updated')"
19+
# Skip if the job was triggered by the SBOM commit or a merge commit in the latest push.
20+
if: "!contains(github.event.head_commit.message, 'Merge pull request') && !contains(github.event.head_commit.message, 'SBOM updated')"
3921
runs-on: ubuntu-latest
4022

4123
steps:

0 commit comments

Comments
 (0)