Skip to content

Commit 81dcc77

Browse files
committed
CI: fix docs/soundness checks for the CLI help snippet
1 parent 758c0ca commit 81dcc77

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎.github/scripts/validate_docs.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ set -x
66
swift run generate-config-docs --check
77

88
./scripts/generate-cli-help-snippets.sh
9-
if ! git diff --exit-code -- Snippets/SwiftJavaCLIHelp.sh; then
10-
echo "::error::Snippets/SwiftJavaCLIHelp.sh is out of date with the swift-java CLI's --help output (likely a command's flags or abstract text changed). Run scripts/generate-cli-help-snippets.sh and commit the result."
9+
if ! git diff --exit-code -- Snippets/SwiftJavaCLIHelp.txt; then
10+
echo "::error::Snippets/SwiftJavaCLIHelp.txt is out of date with the swift-java CLI's --help output (likely a command's flags or abstract text changed). Run scripts/generate-cli-help-snippets.sh and commit the result."
1111
exit 1
1212
fi
1313

‎.github/workflows/pull_request.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
jdk_vendor: ['corretto']
3939
steps:
4040
- uses: actions/checkout@v7
41+
- name: Mark workspace as safe for git
42+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
4143
- name: Prepare CI Environment
4244
uses: ./.github/actions/prepare_env
4345
- name: Cache .build

‎scripts/generate-cli-help-snippets.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
##===----------------------------------------------------------------------===##
1515
##
1616
## Captures the live --help output of the swift-java CLI and writes it to
17-
## Snippets/SwiftJavaCLIHelp.sh, sliced per subcommand so the DocC pages can
17+
## Snippets/SwiftJavaCLIHelp.txt, sliced per subcommand so the DocC pages can
1818
## embed the *actual* --help/USAGE text via @Snippet instead of a pasted copy
1919
## that can drift out of sync with the tool.
2020
##
@@ -25,7 +25,7 @@ set -eu
2525

2626
cd "$(dirname "$0")/.."
2727

28-
OUTPUT_FILE="Snippets/SwiftJavaCLIHelp.sh"
28+
OUTPUT_FILE="Snippets/SwiftJavaCLIHelp.txt"
2929

3030
echo "Building swift-java..."
3131
swift build --product swift-java

0 commit comments

Comments
 (0)