dockerhub-description icon indicating copy to clipboard operation
dockerhub-description copied to clipboard

check and create dockerhub repo before updating description

Open wangkexiong opened this issue 3 years ago • 3 comments
trafficstars

check and create dockerhub repo before updating description

wangkexiong avatar Mar 29 '22 09:03 wangkexiong

Hi @wangkexiong

Thank you for contributing! This looks like a useful feature and I would be happy to support it in this action.

I would like to request some changes to the inputs interface before merging this in.

  1. I think this feature should be optional. So I would like to see a boolean input for this feature which defaults to false.
      createRepository:
        description: >
          Create the Docker Hub repository if it doesn't exist
          Default: `false`
    
  2. I think the default visibility of the created repository should be private.
      createAsPrivate:
        description: >
          Created Docker Hub repositories will have private visibility
          Default: `true`
    

If the interface can be updated to the above then I will be able to release this feature as a minor version bump, rather than it being a breaking change in behaviour.

peter-evans avatar Mar 30 '22 14:03 peter-evans

  1. createRepository is in the critical path to update description of dockerhub project. That's the reason I made this change. If repository is NOT there, update API will surely fail. I suggest we should NOT have this parameter.
  2. For private parameter: since there is only 1 private repository for regular account. I suggest the default value to be false. Otherwise, the create repository API will fail if there is already a private repository.

:-)

wangkexiong avatar Mar 31 '22 15:03 wangkexiong

createRepository is in the critical path to update description of dockerhub project. That's the reason I made this change. If repository is NOT there, update API will surely fail. I suggest we should NOT have this parameter.

The reason for the createRepository input is so I can release this as a minor (feature) version bump. Otherwise it forces me to release it as a major version bump because it's potentially a breaking behaviour change. You might think that all users would be happy with this change, but I guarantee that some users out of the thousands that use this action will not want this feature enabled by default.

I might consider a major version bump where the feature is enabled by default, but even then, the createRepository input should be available to turn it off.

For private parameter: since there is only 1 private repository for regular account. I suggest the default value to be false. Otherwise, the create repository API will fail if there is already a private repository.

I think it's fine for it to fail in that situation. I'm more concerned that the action could accidentally create a public repo and publish something that the user intended to be private. It should default to private to prevent accidental leaks.

peter-evans avatar Apr 04 '22 00:04 peter-evans

Hi @wangkexiong

I've decided not to add this functionality for now. I would like to keep this action as simple as possible. I might come back to it in future, though, if many users express an interest in the action supporting this.

Thank you for the effort to contribute. I do appreciate it.

peter-evans avatar Aug 18 '22 03:08 peter-evans