diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d8d99c8bc20e5..6b5d0e7d34457 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -44,7 +44,7 @@ jobs: with: version: "latest" verb: call - args: publish-all --src . --hub-username matipan --hub-token HOMEBREW_BREW_DOCKER_TOKEN --gh-username franela --gh-token HOMEBREW_BREW_GITHUB_PACKAGES_TOKEN + args: publish-all --src . --hub-username matipan --hub-token HOMEBREW_BREW_DOCKER_TOKEN --gh-username franela --gh-token HOMEBREW_BREW_GITHUB_PACKAGES_TOKEN --commit-sha ${{ github.sha }} #ubuntu: diff --git a/dagger/main.go b/dagger/main.go index e25eade62476f..2b3eb985c968b 100644 --- a/dagger/main.go +++ b/dagger/main.go @@ -29,16 +29,16 @@ func (m *Brew) BaseContainer(src *Directory, version, commitSha, githubRepo, rep WithLabel("org.opencontainers.image.vendor", repoOwner) } -func (m *Brew) PublishAll(ctx context.Context, src *Directory, hubUsername string, hubToken *Secret, ghUsername string, ghToken *Secret) error { - if err := m.Publish(ctx, src, "docker.io", hubUsername, hubToken); err != nil { +func (m *Brew) PublishAll(ctx context.Context, src *Directory, hubUsername string, hubToken *Secret, ghUsername string, ghToken *Secret, commitSHA string) error { + if err := m.Publish(ctx, src, "docker.io", hubUsername, hubToken, commitSHA); err != nil { return err } - return m.Publish(ctx, src, "ghcr.io", ghUsername, ghToken) + return m.Publish(ctx, src, "ghcr.io", ghUsername, ghToken, commitSHA) } -func (m *Brew) Publish(ctx context.Context, src *Directory, registry, username string, token *Secret) error { +func (m *Brew) Publish(ctx context.Context, src *Directory, registry, username string, token *Secret, commitSHA string) error { for _, version := range versions { - c := m.BaseContainer(src, version, "foo", "franela/brew", "franela", version) + c := m.BaseContainer(src, version, commitSHA, "franela/brew", "franela", version) addr, err := c. WithRegistryAuth(registry, username, token).