Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when pushing to ghcr.io for organizations containing uppercase letters #18

Closed
wants to merge 7 commits into from
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
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v1

- name: Set up Go 1.13
- name: Set up Go 1.16
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: 1.16

- name: Download dependencies
run: go mod vendor
Expand All @@ -27,7 +27,7 @@ jobs:
run: bash <(curl -s https://codecov.io/bash) -f coverage.out

- name: Publish
uses: jerray/publish-docker-action@v1.0.0
uses: hartmutobendorf/publish-docker-action@v0.0.1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13-alpine as builder
FROM golang:1.16-alpine as builder

WORKDIR /src
COPY . /src
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Publish Docker Action

Based on https://github.com/jerray/publish-docker-action, this fixes the problem of building docker and pushing docker images, documented in https://github.com/jerray/publish-docker-action/pull/18.

[![GitHub Action](https://github.com/jerray/publish-docker-action/workflows/Main/badge.svg)](https://github.com/jerray/publish-docker-action/actions?workflow=Main)
[![codecov](https://codecov.io/gh/jerray/publish-docker-action/branch/master/graph/badge.svg)](https://codecov.io/gh/jerray/publish-docker-action)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/jerray/publish-docker-action?logo=github)](https://github.com/jerray/publish-docker-action/releases)
Expand All @@ -14,7 +16,7 @@ tag and push to docker default registry (docker.io). Repository name is your Git
name by default.

```yaml
- uses: jerray/publish-docker-action@master
- uses: hartmutobendorf/publish-docker-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand All @@ -28,12 +30,12 @@ You can set docker registry with `registry` argument. Change docker repository n
For example:

```yaml
- uses: jerray/publish-docker-action@master
- uses: hartmutobendorf/publish-docker-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: docker.pkg.github.com
repository: jerray/publish-docker-action
repository: Chainstep/publish-docker-action
```

This will build and push the tag `docker.pkg.github.com/jerray/publish-docker-action:latest`.
Expand All @@ -45,12 +47,12 @@ This will build and push the tag `docker.pkg.github.com/jerray/publish-docker-ac
You can use static tag list by providing `tags` argument. Concat multiple tag names with commas.

```yaml
- uses: jerray/publish-docker-action@master
- uses: hartmutobendorf/publish-docker-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: docker.pkg.github.com
repository: jerray/publish-docker-action
repository: Chainstep/publish-docker-action
tags: latest,newest,master
```

Expand All @@ -65,12 +67,12 @@ This example builds the image, creates three tags, and pushes all of them to the
Set `with.auto_tag: true` to allow action generate docker image tags automatically.

```yaml
- uses: jerray/publish-docker-action@master
- uses: hartmutobendorf/publish-docker-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: docker.pkg.github.com
repository: jerray/publish-docker-action
repository: Chainstep/publish-docker-action
auto_tag: true
```

Expand Down Expand Up @@ -98,12 +100,12 @@ Additionally, there's an output value `tag` you can use [in your next steps](htt

```yaml
- id: build
uses: jerray/publish-docker-action@master
uses: hartmutobendorf/publish-docker-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: docker.pkg.github.com
repository: jerray/publish-docker-action
repository: Chainstep/publish-docker-action
auto_tag: true

- id: deploy
Expand All @@ -122,12 +124,12 @@ Provide `with.cache` argument to build from cache.
Use `with.build_args` to provide docker build-time variables. Multiple variables must be separated by comma.

```yaml
- uses: jerray/publish-docker-action@master
- uses: hartmutobendorf/publish-docker-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: docker.pkg.github.com
repository: jerray/publish-docker-action
repository: Chainstep/publish-docker-action
build_args: HTTP_PROXY=http://127.0.0.1,USER=nginx
```

Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Publish Docker Action'
description: 'Build, tag and publish docker image to your docker registry'
author: 'jerray'
author: 'hartmutobendorf, jerray'
inputs:
username:
description: 'Username used to login docker registry'
Expand Down Expand Up @@ -48,7 +48,7 @@ outputs:
description: 'Tag name produced by activating the auto_tag option'
runs:
using: 'docker'
image: 'docker://jerray/publish-docker-action:1.0.5'
image: 'docker://hartmutobendorf/publish-docker-action:1.0.0'
branding:
icon: 'anchor'
color: 'blue'
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/jerray/publish-docker-action
module github.com/Chainstep/publish-docker-action

go 1.13
go 1.16

require github.com/caarlos0/env/v6 v6.0.0
2 changes: 1 addition & 1 deletion helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func resolveInputs(github GitHub, inputs *Inputs) error {
resolveAutoTag(typ, name, inputs)

for i, t := range inputs.Tags {
inputs.Tags[i] = strings.Join([]string{inputs.Repository, t}, ":")
inputs.Tags[i] = strings.Join([]string{strings.ToLower(inputs.Repository), t}, ":")
}

return nil
Expand Down