Skip to content

Commit

Permalink
provide additional information if reading a change file fails (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
miniscruff authored Oct 21, 2023
1 parent d2a0b1f commit 18607a1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changes/unreleased/Fixed-20231021-132322.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: Fixed
body: Provide a better error message if a change file is invalid
time: 2023-10-21T13:23:22.077665894-07:00
custom:
Issue: "554"
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ on:
push:
branches: [ main ]
paths:
- 'cmd/'
- 'core/'
- 'shared/'
- 'then/'
- 'cmd/**'
- 'core/**'
- 'shared/**'
- 'then/**'
- 'main.go'
- 'go.sum'
pull_request:
branches: [ main ]
paths:
- 'cmd/'
- 'core/'
- 'shared/'
- 'then/'
- 'cmd/**'
- 'core/**'
- 'shared/**'
- 'then/**'
- 'main.go'
- 'go.sum'

Expand Down
4 changes: 2 additions & 2 deletions core/change.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,12 @@ func LoadChange(path string, rf shared.ReadFiler) (Change, error) {

bs, err := rf(path)
if err != nil {
return c, err
return c, fmt.Errorf("reading change file '%s': %w", path, err)
}

err = yaml.Unmarshal(bs, &c)
if err != nil {
return c, err
return c, fmt.Errorf("unmarshaling change file '%s': %w", path, err)
}

c.Filename = path
Expand Down

0 comments on commit 18607a1

Please sign in to comment.