andrewslotin / go-proxy-pull-action

Pull the new release of a module to the Go proxy cache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Account name differs from Go import URL

docktermj opened this issue · comments

@andrewslotin Love your work, we use it.

However, we realized that we have an issue that was unforeseen: Our GitHub account has a capital letter, but our Go import URLs are all lower case.

We're considering writing a version of your code at https://github.com/Senzing/github-action-go-proxy-pull, but if you are able to accommodate this requirement, we'd be happy to continue using your GitHub Action.

Essentially we are adding code like this:

PACKAGE=$(echo ${PACKAGE} | tr '[:upper:]' '[:lower:]')

for our case, but you would have to be sensitive to other conditions that your users may have.

Our special case may not lend itself well to the work you have done. We just wanted to make you aware of what we're doing.

Hey @docktermj, thanks for the heads up and your kind words. I believe there is another way to address your issue that other users may benefit from. Currently this action assumes that import path always matches the GitHub repository name, which is not always the case, since Go allows to use custom URLs as imports path as long as they respond with an HTML doc containing <meta name="go-import"> tag that points to the actual module location. I believe this case is rather rare, yet not completely impossible.

I'm thinking of making the import path configurable via an env var and using the GitHub repo as a default, so in your case you'll need to update your workflow configuration and provide package import path as a parameter. Does this make sense?

@andrewslotin That's an excellent improvement. Once your PR is pulled into your main branch and versioned we'll start using it and delete our https://github.com/Senzing/github-action-go-proxy-pull repository. Thank you for your prompt attention to this. We weren't expecting it and are delighted. Keep up the good work!

Once you have pulled your changes into the main branch, feel free to close this issue.

@docktermj, I've just released v1.1.0 of this action on GitHub Marketplace.

@andrewslotin There may still be an issue. I've configured my yaml file like this:

https://github.com/Senzing/template-go/blob/0d48946dcaa1a2a6db55dc9100b02a80f8e9847e/.github/workflows/go-proxy-pull.yaml

And am getting this result:

2023-02-07T14:28:42.0289063Z Requested labels: ubuntu-latest
2023-02-07T14:28:42.0289112Z Job defined at: Senzing/template-go/.github/workflows/go-proxy-pull.yaml@refs/tags/v0.1.0
2023-02-07T14:28:42.0289147Z Waiting for a runner to pick up this job...
2023-02-07T14:28:42.3496058Z Job is waiting for a hosted runner to come online.
2023-02-07T14:28:46.4767872Z Job is about to start running on the hosted runner: Hosted Agent (hosted)
2023-02-07T14:28:48.7594724Z Current runner version: '2.301.1'
2023-02-07T14:28:48.7620380Z ##[group]Operating System
2023-02-07T14:28:48.7620862Z Ubuntu
2023-02-07T14:28:48.7621129Z 22.04.1
2023-02-07T14:28:48.7621387Z LTS
2023-02-07T14:28:48.7621615Z ##[endgroup]
2023-02-07T14:28:48.7621997Z ##[group]Runner Image
2023-02-07T14:28:48.7622339Z Image: ubuntu-22.04
2023-02-07T14:28:48.7622599Z Version: 20230129.2
2023-02-07T14:28:48.7623072Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230129.2/images/linux/Ubuntu2204-Readme.md
2023-02-07T14:28:48.7623720Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230129.2
2023-02-07T14:28:48.7624150Z ##[endgroup]
2023-02-07T14:28:48.7624429Z ##[group]Runner Image Provisioner
2023-02-07T14:28:48.7624747Z 2.0.98.1
2023-02-07T14:28:48.7625013Z ##[endgroup]
2023-02-07T14:28:48.7625908Z ##[group]GITHUB_TOKEN Permissions
2023-02-07T14:28:48.7626478Z Actions: write
2023-02-07T14:28:48.7626769Z Checks: write
2023-02-07T14:28:48.7627237Z Contents: write
2023-02-07T14:28:48.7627545Z Deployments: write
2023-02-07T14:28:48.7627852Z Discussions: write
2023-02-07T14:28:48.7628105Z Issues: write
2023-02-07T14:28:48.7628404Z Metadata: read
2023-02-07T14:28:48.7628729Z Packages: write
2023-02-07T14:28:48.7629021Z Pages: write
2023-02-07T14:28:48.7629276Z PullRequests: write
2023-02-07T14:28:48.7629623Z RepositoryProjects: write
2023-02-07T14:28:48.7629999Z SecurityEvents: write
2023-02-07T14:28:48.7630263Z Statuses: write
2023-02-07T14:28:48.7630558Z ##[endgroup]
2023-02-07T14:28:48.7634085Z Secret source: Actions
2023-02-07T14:28:48.7634506Z Prepare workflow directory
2023-02-07T14:28:48.8459717Z Prepare all required actions
2023-02-07T14:28:48.8642926Z Getting action download info
2023-02-07T14:28:49.2479474Z Download action repository 'andrewslotin/go-proxy-pull-action@v1.1.0' (SHA:50fea06a976087614babb9508e5c528b464f4645)
2023-02-07T14:28:49.8477144Z Complete job name: Renew documentation
2023-02-07T14:28:49.9235497Z ##[group]Build container for action use: '/home/runner/work/_actions/andrewslotin/go-proxy-pull-action/v1.1.0/Dockerfile'.
2023-02-07T14:28:49.9310781Z ##[command]/usr/bin/docker build -t 49859c:0251d25fe07d44a6b745576d595ae272 -f "/home/runner/work/_actions/andrewslotin/go-proxy-pull-action/v1.1.0/Dockerfile" "/home/runner/work/_actions/andrewslotin/go-proxy-pull-action/v1.1.0"
2023-02-07T14:28:50.0482231Z Sending build context to Docker daemon  10.24kB
2023-02-07T14:28:50.0488087Z 
2023-02-07T14:28:50.0853558Z Step 1/3 : FROM golang:1.18-alpine
2023-02-07T14:28:50.7687438Z 1.18-alpine: Pulling from library/golang
2023-02-07T14:28:50.9373658Z 8921db27df28: Already exists
2023-02-07T14:28:50.9375324Z a2f8637abd91: Pulling fs layer
2023-02-07T14:28:50.9375768Z 4ba80a8cd2c7: Pulling fs layer
2023-02-07T14:28:50.9376221Z dbc2308a4587: Pulling fs layer
2023-02-07T14:28:51.1239288Z dbc2308a4587: Verifying Checksum
2023-02-07T14:28:51.1240638Z dbc2308a4587: Download complete
2023-02-07T14:28:51.1719225Z a2f8637abd91: Verifying Checksum
2023-02-07T14:28:51.1719633Z a2f8637abd91: Download complete
2023-02-07T14:28:51.3359220Z a2f8637abd91: Pull complete
2023-02-07T14:28:51.9819850Z 4ba80a8cd2c7: Verifying Checksum
2023-02-07T14:28:51.9820191Z 4ba80a8cd2c7: Download complete
2023-02-07T14:28:57.4865617Z 4ba80a8cd2c7: Pull complete
2023-02-07T14:28:57.5376312Z dbc2308a4587: Pull complete
2023-02-07T14:28:57.5417497Z Digest: sha256:77f25981bd57e60a510165f3be89c901aec90453fd0f1c5a45691f6cb1528807
2023-02-07T14:28:57.5434344Z Status: Downloaded newer image for golang:1.18-alpine
2023-02-07T14:28:57.5500440Z  ---> a77f45e5f987
2023-02-07T14:28:57.5500837Z Step 2/3 : COPY entrypoint.sh /entrypoint.sh
2023-02-07T14:28:58.0599952Z  ---> ea1400274dfc
2023-02-07T14:28:58.0601767Z Step 3/3 : ENTRYPOINT ["/entrypoint.sh"]
2023-02-07T14:28:58.0667791Z  ---> Running in 8f8a95983dc2
2023-02-07T14:28:59.0304451Z Removing intermediate container 8f8a95983dc2
2023-02-07T14:28:59.0304969Z  ---> 2b3587a2e0d4
2023-02-07T14:28:59.0305292Z Successfully built 2b3587a2e0d4
2023-02-07T14:28:59.0354147Z Successfully tagged 49859c:0251d25fe07d44a6b745576d595ae272
2023-02-07T14:28:59.0371278Z ##[endgroup]
2023-02-07T14:28:59.0741022Z ##[group]Run andrewslotin/go-proxy-pull-action@v1.1.0
2023-02-07T14:28:59.0741351Z with:
2023-02-07T14:28:59.0741635Z   import_path: github.com/senzing
2023-02-07T14:28:59.0742000Z   goproxy: https://proxy.golang.org
2023-02-07T14:28:59.0742320Z ##[endgroup]
2023-02-07T14:28:59.1030866Z ##[command]/usr/bin/docker run --name c0251d25fe07d44a6b745576d595ae272_54a8c5 --label 49859c --workdir /github/workspace --rm -e "INPUT_IMPORT_PATH" -e "INPUT_GOPROXY" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/template-go/template-go":"/github/workspace" 49859c:0251d25fe07d44a6b745576d595ae272
2023-02-07T14:28:59.4079122Z go: creating new go.mod: module dummy
2023-02-07T14:28:59.5134920Z go: github.com/senzing@v0.1.0: reading https://proxy.golang.org/github.com/senzing/@v/v0.1.0.info: 404 Not Found
2023-02-07T14:28:59.5135462Z 	server response: not found: invalid github.com import path "github.com/senzing"
2023-02-07T14:28:59.6490791Z Cleaning up orphan processes

@andrewslotin Did I misconfigure my YAML file to get this error?

2023-02-07T14:28:59.5134920Z go: github.com/senzing@v0.1.0: reading https://proxy.golang.org/github.com/senzing/@v/v0.1.0.info: 404 Not Found

@docktermj, it looks like you did :) github.com/senzing does not seem like a valid import path for a Go package to me. Did you miss the package name at the end?

@andrewslotin That could be it. Let me give that a try.

@andrewslotin I think you found the fix. We're all good. Thank you for your help. I'll be deleting our repository.