Skip to content

Commit 3088143

Browse files
Update bundle_2.0_schemas.yml
Signed-off-by: Steve Springett <[email protected]>
1 parent b80ee64 commit 3088143

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

.github/workflows/bundle_2.0_schemas.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,20 @@ jobs:
3939
../../../../schema/2.0/model \
4040
../../../../schema/2.0/cyclonedx-2.0.schema.json
4141
42-
- name: Check for changes
43-
id: git-check
42+
- name: Check for changes and commit
4443
run: |
4544
BUNDLED_FILE="schema/2.0/cyclonedx-2.0-bundled.schema.json"
4645
47-
# Check if file is untracked (new)
48-
if ! git ls-files --error-unmatch "$BUNDLED_FILE" > /dev/null 2>&1; then
49-
echo "Bundled schema is new, adding to git"
50-
git add "$BUNDLED_FILE"
51-
echo "changed=true" >> $GITHUB_OUTPUT
52-
# Check if tracked file has changes
53-
elif ! git diff --exit-code "$BUNDLED_FILE" > /dev/null 2>&1; then
54-
echo "Bundled schema has changes"
55-
git add "$BUNDLED_FILE"
56-
echo "changed=true" >> $GITHUB_OUTPUT
57-
else
46+
# Add the file (works for both new and modified files)
47+
git add "$BUNDLED_FILE"
48+
49+
# Check if there are staged changes
50+
if git diff --staged --quiet; then
5851
echo "No changes to bundled schema"
59-
echo "changed=false" >> $GITHUB_OUTPUT
52+
else
53+
echo "Committing bundled schema changes"
54+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
55+
git config --local user.name "github-actions[bot]"
56+
git commit -m "chore: update bundled schema [skip ci]"
57+
git push
6058
fi
61-
62-
- name: Commit and push changes
63-
if: steps.git-check.outputs.changed == 'true'
64-
run: |
65-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
66-
git config --local user.name "github-actions[bot]"
67-
git commit -m "chore: update bundled schema [skip ci]"
68-
git push

0 commit comments

Comments
 (0)