Skip to content

Commit 344dfe4

Browse files
Fix YAML syntax errors in rust.yml workflow (#8)
* Initial plan * Fix YAML syntax errors in rust.yml workflow Co-authored-by: elasticdotventures <[email protected]> * Fix apply_tldr logic to properly handle multiple LICENSE/VERSION sections Co-authored-by: elasticdotventures <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: elasticdotventures <[email protected]>
1 parent c7fc89c commit 344dfe4

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

.github/workflows/rust.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@ name: Rust
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: ["main"]
88

99
env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
1615

1716
steps:
18-
- uses: actions/checkout@v4
19-
- name: Build
20-
run: cargo build --verbose
21-
- name: Run tests
22-
run: cargo test --verbose
17+
- uses: actions/checkout@v4
18+
- name: Build
19+
run: cargo build --verbose
20+
- name: Run tests
21+
run: cargo test --verbose

src/tools/tldr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ pub fn apply_tldr(input: &str) -> String {
1414
let detail_tag_re = Regex::new(r"<[/]?detail.*?>").unwrap();
1515

1616
for line in input.lines() {
17-
// Start skipping if we hit a LICENSE or VERSION(S) heading
18-
if !skip && tldr_section_re.is_match(line) {
17+
// Check if this is a LICENSE or VERSION(S) heading
18+
if tldr_section_re.is_match(line) {
1919
skip = true;
2020
continue; // skip the heading line itself
2121
}
22-
// Stop skipping at the next heading (but do not skip the heading itself)
22+
// Stop skipping at the next heading (that's not LICENSE/VERSION)
2323
if skip && heading_re.is_match(line) {
2424
skip = false;
2525
}

0 commit comments

Comments
 (0)