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 failed to push kufu-ai/gocat:latest: push access denied, reposito… #1139

Conversation

pirlodog1125
Copy link
Contributor

@pirlodog1125 pirlodog1125 commented Sep 6, 2024

User description

…ry does not exist

fix

ERROR: failed to solve: failed to push kufu-ai/gocat:latest: push access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

PR Type

Bug fix, Configuration changes


Description

  • Docker image push failure was fixed by introducing a new environment variable DOCKERHUB_REPO_OWNER.
  • The image ID construction was updated to use the new DOCKERHUB_REPO_OWNER variable instead of github.repository_owner.
  • These changes ensure the correct repository owner is used for Docker image operations.

Changes walkthrough 📝

Relevant files
Configuration changes
docker-publish.yml
Fix Docker image push by updating repository owner configuration

.github/workflows/docker-publish.yml

  • Added DOCKERHUB_REPO_OWNER environment variable.
  • Changed image ID construction to use DOCKERHUB_REPO_OWNER.
  • +2/-1     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link

    github-actions bot commented Sep 6, 2024

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Key issues to review

    環境変数の使用
    DOCKERHUB_REPO_OWNER 環境変数がセキュリティリスクを引き起こす可能性があります。この変数が公開されると、不正なアクセスが可能になるかもしれません。環境変数の取り扱いには注意が必要です。

    Copy link

    github-actions bot commented Sep 6, 2024

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    環境変数が設定されているかを確認し、設定されていない場合はエラーを出力します。

    DOCKERHUB_REPO_OWNER 環境変数を使用する前に、この変数が正しく設定されているか確認してください。GitHub Actions のシークレットに
    DOCKERHUB_REPO_OWNER が存在するか、または適切なデフォルト値を設定することをお勧めします。

    .github/workflows/docker-publish.yml [79]

    +if [ -z "$DOCKERHUB_REPO_OWNER" ]; then
    +  echo "Error: DOCKERHUB_REPO_OWNER is not set."
    +  exit 1
    +fi
     IMAGE_ID=$DOCKERHUB_REPO_OWNER/$IMAGE_NAME
     
    Suggestion importance[1-10]: 9

    Why: The suggestion correctly identifies a potential issue where the DOCKERHUB_REPO_OWNER environment variable might not be set, which could lead to errors during execution. Adding a check ensures robustness and prevents unexpected failures, making it a significant improvement.

    9

    @pirlodog1125 pirlodog1125 merged commit 168a8df into master Sep 6, 2024
    7 checks passed
    @pirlodog1125 pirlodog1125 deleted the fix-failed-to-push-kufu-ai/gocatlatest-push-access-denied,-repository-does-not-exist branch September 6, 2024 02:13
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant