Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/renovate/bump/bump.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ func New(ctx context.Context, opts ...Option) renovate.Renovator {
RecurseNodes().
Filter(yit.WithMapValue("git-checkout"))

for gitCheckoutNode, ok := it(); ok; gitCheckoutNode, ok = it() {
// Only run updateGitCheckout once for the first git-checkout node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds like a limitation. I'd consider instead to request support for checking updates for any of the git-checkouts.

if gitCheckoutNode, ok := it(); ok {
if err := updateGitCheckout(ctx, gitCheckoutNode, bcfg.ExpectedCommit); err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions pkg/renovate/bump/bump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func TestBump_withMultipleCheckouts(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, rs.Pipeline[0].With["expected-commit"], "1234abcd")
assert.Equal(t, rs.Pipeline[1].With["expected-commit"], "bar")
assert.Equal(t, rs.Pipeline[2].With["expected-commit"], "water")
}

func setupTestServer(t *testing.T) (error, *httptest.Server) {
Expand Down
8 changes: 8 additions & 0 deletions pkg/renovate/bump/testdata/multiple_checkouts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ package:
epoch: 2
description: "a cheesy library"

vars:
pasts: "7.1"

pipeline:
- uses: git-checkout
with:
Expand All @@ -15,3 +18,8 @@ pipeline:
repository: cheese/cheese
expected-commit: bar
tag: crackers
- uses: git-checkout
with:
repository: cheese/pasta
expected-commit: water
tag: ${{vars.pasts}}
Loading