Comments (5)
Hi @matross-gh thanks for filing an issue! If you could could you let us know what version of actions-sync
you encountered this issue in? I noticed that this project is not using matrix build for Windows so it very well could be a Go related issue. We'll work on reproducing the issue internally as well.
from actions-sync.
@shawnHartsell Hi there! Sure thing! I am using GHES Actions Sync v0.2 obtained from issuing the command actions-sync version.
from actions-sync.
@matross-gh I was able to repro this, and admit should have seen the problem sooner 😢. I believe you're encountering this issue b/c your using http
instead of https
for --destination-url
. Can you update your command and see if that works for you?
Details
When http
is used, the REST API returns a 301
. Furthermore, the http.Client
that's used to create the go-github
Client
is configured with the default behavior to follow redirects, which results in a GET being executed to the endpoint instead.
In the case of creating a repo (the last action in the sync
command) what actually ends up happening is that repos for the user/org are being fetched. The response body for fetching repos is an array which causes the Marshaling error ([]Repo to Repo)
Below is an example taken from one of my test GHES instance via curl
:
curl -v -L \
-X GET \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer REDACTED" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http://REDACTED/api/v3/orgs/shawnhartsell/repos \
-d '{"name":"Hello-World","description":"This is your first repository","homepage":"https://github.com","private":false,"has_issues":true,"has_projects":true,"has_wiki":true}'
...
< HTTP/1.1 301 Moved Permanently
< Content-Length: 0
* Please rewind output before next send
< Location: https://REDACTED/api/v3/orgs/shawnhartsell/repos
< connection: close
<
* Closing connection
* Clear auth, redirects to port from 80 to 443
* Issue another request to this URL: 'https://REDACTED/api/v3/orgs/shawnhartsell/repos'
* Switch from POST to GET
* ....TLS STUFF REMOVED FOR BREVITY
> GET /api/v3/orgs/shawnhartsell/repos HTTP/2
> Host: REDACTED
> User-Agent: curl/8.4.0
> Accept: application/vnd.github+json
> X-GitHub-Api-Version: 2022-11-28
>
< HTTP/2 401
< server: GitHub.com
< date: Wed, 17 Apr 2024 16:47:20 GMT
< content-type: application/json; charset=utf-8
< content-length: 135
< x-github-enterprise-version: 3.10.9
{
"message": "Must authenticate to access this API.",
"documentation_url": "https://docs.github.com/[email protected]/rest"
}
from actions-sync.
@shawnHartsell Wow! Thank you! That worked! I can't believe I did that! sheesh! Using same version with same tooling on my laptop, no change there.
Command (with HTTPS on --destination-url parameter)
actions-sync sync --cache-dir 'c:\temp' --destination-token 'ghp_abc123' --destination-url 'https://myinstanceFQDN' --repo-name 'docker/bake-action'
Pardon the use of ghe-admin, just forming the repeatable process here. I will be using a different account for this action.
Thank you very much and my apologies for such a late reply!
from actions-sync.
No problem! Glad that resolved your issue. As a follow up I created #128 to force the use of HTTPs. I also noticed that the version
command is not outputting correct data so I created #129 as well.
from actions-sync.
Related Issues (20)
- Allow filtering comments in `repo-name-list-file`
- Force the use of HTTPS in source and destination URL flags
- version command does not return correct data
- Reference delta not found error when pulling a repo HOT 10
- optional parameter --destination-token? HOT 4
- Remove requirement on PAT and allow Application Access Token too HOT 3
- Easier to fetch Actions org HOT 4
- How could I synchronize an action repo which requires authentication? HOT 2
- Tracking: Support syncing the release assets as well HOT 2
- How are checksums calculated HOT 2
- Default branch of synchronized repository is wrong when source has master as default branch HOT 4
- authorization failed while pushing HOT 1
- hacked this is not me--close this
- Feature Request - allow sync to a GHEC Organization to enable allowlists for GHEC. HOT 2
- Feature Request - Support for syncing actions from private repos HOT 8
- Feature Request: Dissable actions inside synced action HOT 3
- Scope for fine-grained PAT HOT 3
- darwin-arm64 release HOT 1
- Linux amd64 release binary depends on `glibc` version `2.32` HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actions-sync.