Skip to content

Commit

Permalink
add commit sha to publish
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Lilljedahl <[email protected]>
  • Loading branch information
marcosnils committed Jun 14, 2024
1 parent 18ad415 commit 35f46e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions dagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 35f46e4

Please sign in to comment.