Skip to content

Commit

Permalink
Don't log in to docker hub in dependabot PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Oct 28, 2024
2 parents 749c784 + 537f883 commit 660d7c6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stores/sql/mysql/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,18 @@ func (c chainUpdateTx) UpdateHost(hk types.PublicKey, ha chain.HostAnnouncement,
return fmt.Errorf("failed to fetch allow list: %w", err)
}
defer rows.Close()

allowlistEntries := make(map[types.PublicKey]int64)
for rows.Next() {
var id int64
var pk ssql.PublicKey
if err := rows.Scan(&id, &pk); err != nil {
return fmt.Errorf("failed to scan row: %w", err)
}
allowlistEntries[types.PublicKey(pk)] = id
}

for pk, id := range allowlistEntries {
if hk == types.PublicKey(pk) {
if _, err := c.tx.Exec(c.ctx,
"INSERT IGNORE INTO host_allowlist_entry_hosts (db_allowlist_entry_id, db_host_id) VALUES (?,?)",
Expand Down
6 changes: 6 additions & 0 deletions stores/sql/sqlite/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,18 @@ func (c chainUpdateTx) UpdateHost(hk types.PublicKey, ha chain.HostAnnouncement,
return fmt.Errorf("failed to fetch allow list: %w", err)
}
defer rows.Close()

allowlistEntries := make(map[types.PublicKey]int64)
for rows.Next() {
var id int64
var pk ssql.PublicKey
if err := rows.Scan(&id, &pk); err != nil {
return fmt.Errorf("failed to scan row: %w", err)
}
allowlistEntries[types.PublicKey(pk)] = id
}

for pk, id := range allowlistEntries {
if hk == types.PublicKey(pk) {
if _, err := c.tx.Exec(c.ctx,
"INSERT OR IGNORE INTO host_allowlist_entry_hosts (db_allowlist_entry_id, db_host_id) VALUES (?,?)",
Expand Down

0 comments on commit 660d7c6

Please sign in to comment.