Skip to content

Commit 4be2e2d

Browse files
jsorefgithub-actions[bot]
authored and
github-actions[bot]
committed
Strip trailing whitespace generated by ruamel-yaml
1 parent f93ba41 commit 4be2e2d

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

.github/workflows/debug-artifacts-failure.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
run: ./build.sh
5151
- uses: ./../action/analyze
5252
id: analysis
53-
env:
53+
env:
5454
# Forces a failure in this step.
5555
CODEQL_ACTION_EXTRA_OPTIONS: '{ "database": { "finalize": ["--invalid-option"] } }'
5656
with:

.github/workflows/debug-artifacts-legacy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
debug-artifact-name: my-debug-artifacts
5757
debug-database-name: my-db
5858
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
59-
languages: cpp,csharp,go,java,javascript,python,ruby
59+
languages: cpp,csharp,go,java,javascript,python,ruby
6060
- name: Build code
6161
shell: bash
6262
run: ./build.sh

.github/workflows/debug-artifacts.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
debug-artifact-name: my-debug-artifacts
5656
debug-database-name: my-db
5757
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
58-
languages: cpp,csharp,go,java,javascript,python,ruby
58+
languages: cpp,csharp,go,java,javascript,python,ruby
5959
- name: Build code
6060
shell: bash
6161
run: ./build.sh

pr-checks/sync.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from ruamel.yaml.scalarstring import FoldedScalarString, SingleQuotedScalarString
55
import pathlib
66
import textwrap
7+
import os
78

89
# The default set of CodeQL Bundle versions to use for the PR checks.
910
defaultTestVersions = [
@@ -153,7 +154,8 @@ def writeHeader(checkStream):
153154
checkJob['env']['CODEQL_ACTION_TEST_MODE'] = True
154155
checkName = file.stem
155156

156-
with open(this_dir.parent / ".github" / "workflows" / f"__{checkName}.yml", 'w') as output_stream:
157+
raw_file = this_dir.parent / ".github" / "workflows" / f"__{checkName}.yml.raw"
158+
with open(raw_file, 'w') as output_stream:
157159
writeHeader(output_stream)
158160
yaml.dump({
159161
'name': f"PR Check - {checkSpecification['name']}",
@@ -175,3 +177,9 @@ def writeHeader(checkStream):
175177
checkName: checkJob
176178
}
177179
}, output_stream)
180+
181+
with open(raw_file, 'r') as input_stream:
182+
with open(this_dir.parent / ".github" / "workflows" / f"__{checkName}.yml", 'w') as output_stream:
183+
content = input_stream.read()
184+
output_stream.write("\n".join(list(map(lambda x:x.rstrip(), content.splitlines()))+['']))
185+
os.remove(raw_file)

0 commit comments

Comments
 (0)