Skip to content

Commit

Permalink
fix: missing config file should not fail pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jippi committed Aug 30, 2024
1 parent 63a0218 commit 0e94cc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/gitlab/script-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ duration("1h").Seconds() == 3600
Returns the [`time.Duration`](https://pkg.go.dev/time#Duration) value since the provided `time`.

```css
since(now() + duration("1h))== 3600
since(now() + duration("1h)) == 3600
```

### `uniq([]string) -> []string` {: #uniq data-toc-label="uniq"}
Expand Down
6 changes: 6 additions & 0 deletions pkg/scm/gitlab/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ func (client *Client) Stop(ctx context.Context, err error) error {

if err != nil {
status = go_gitlab.Failed

// If the evaluation failed due to no config file, consider it a "skip" instead
if strings.Contains(err.Error(), "could not read remote config file") {
status = go_gitlab.Skipped
}

message = err.Error()
}

Expand Down

0 comments on commit 0e94cc9

Please sign in to comment.