Skip to content

Commit e9128f8

Browse files
chore: Add report-warnings-as-errors so the user can choose to exit early
1 parent 16b6c40 commit e9128f8

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ This GitHub Action validates if an Xcode project file is sorted.
88

99
**Required** The path to the Xcode project file.
1010

11+
### `report-warnings-as-error`
12+
13+
**Optional** Report warnings as errors. Defaults to `false`.
14+
1115
## Example usage
1216

1317
```yaml
1418
uses: nthState/ValidateXcodeProjectSorted
1519
with:
1620
project-path: './ios/App.xcodeproj'
21+
report-warnings-as-error: true
1722
```

action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ inputs:
44
project-path:
55
description: 'Path to the Xcode project file'
66
required: true
7+
report-warnings-as-error:
8+
description: 'Report warnings as errors'
9+
required: false
10+
default: false
711
runs:
812
using: 'composite'
913
steps:
@@ -18,6 +22,10 @@ runs:
1822
perl ./scripts/sort-xcode-project-file.pl "${{ inputs['project-path'] }}"
1923
2024
if ! [ -z "$(git status --porcelain | grep -e pbxproj$)" ]; then
21-
echo "Project file is not sorted, this may make it harder to merge"
22-
exit 1
25+
if [ "${{ inputs['report-warnings-as-error'] }}" = "true" ]; then
26+
echo "Project file is not sorted, this may make it harder to merge"
27+
exit 1
28+
else
29+
echo "::warning::Project file is not sorted, this may make it harder to merge"
30+
fi
2331
fi

0 commit comments

Comments
 (0)