Skip to content

Commit

Permalink
Ignore excluded entries when unpinning (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo authored May 24, 2022
1 parent 3502a40 commit b2eee82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func Unpin(m *yaml.Node) error {
return nil
}

if m.LineComment != "" {
if m.LineComment != "" && !shouldExclude(m.LineComment) {
if v, rest := extractOriginalFromComment(m.LineComment); v != "" {
m.Value = v
m.LineComment = rest
Expand Down
5 changes: 5 additions & 0 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ func TestUnpin(t *testing.T) {
- uses: "i/am@pinned" # comment
`,
},
{
name: "exclude_comment",
in: `uses: "my/repo@v0" # ratchet:exclude more comment`,
exp: `uses: "my/repo@v0" # ratchet:exclude more comment`,
},
}

for _, tc := range cases {
Expand Down

0 comments on commit b2eee82

Please sign in to comment.