-
Notifications
You must be signed in to change notification settings - Fork 206
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
Enterprise Github Support #89
Comments
@Drjacky Currently, github-profile-3d-contrib does not support Github Enterprise. From what I can see in the Github Enterprise documentation, it seems to support the same API (GraphQL), so if there are no restrictions on the Github Enterprise side, it may be possible to just change the API destination and have it work without any other modifications. However, I don't have the environment to check and can't provide immediate support. If you want to fork github-profile-3d-contrib, modify it, and test it, the place to modify is the URL near the top of - export const URL = 'https://api.github.com/graphql';
+ export const URL = 'https://api.github.mycompany.com/graphql';
The User-created secrets cannot start with Create your own secret and set it in the For example, if you created a secret with a name like env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_TOKEN: ${{ secrets.MY_PERSONAL_ACCESS_TOKEN }} Please also see Issue #60. |
Thanks for your attention! I cloned your repo (because my company's enterprise doesn't allow to have secrets environment, so I cloned and pushed the repo as private) name: GitHub-Enterprise-Profile-3D-Contrib
on:
schedule: # 03:00 JST == 18:00 UTC
- cron: "0 18 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: generate-github-enterprise-profile-3d-contrib
steps:
- uses: actions/checkout@v3
- uses: Drjacky/github-profile-3d-contrib@0.7.1
# I even used - uses: Drjacky/github-enterprise-profile-3d-contrib@0.7.1
env:
GITHUB_TOKEN: ${{ secrets.MY_COMPANY_PERSONAL_ACCESS_TOKEN }}
USERNAME: ${{ github.repository_owner }}
SETTING_JSON: ./profile-3d-contrib/ever-green-custom.json
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: python ./bin/change-border.py profile-3d-contrib/profile-custom-evergreen.svg profile-3d-contrib/profile-custom-evergreen-with-border.svg
- name: Commit & Push
run: |
git config user.name github-actions
git config user.email github-actions@github.mycompany.com
git add -A .
git commit -m "3d-contrib generated"
git push But I get:
or
|
Even when I forked, it still throws
|
Okay, that
|
I tried both
and still:
|
To help me understand, let me go through the prerequisites.
Is the above correct? In that case, you first need to do the following with your company account.
Next, modify
If possible, you should run it locally to make sure it works correctly. How to run it locally (Linux, Windows WSL2, etc.) is written in README.md.
Finally, to run Github Actions, create a workflow (YAML file) in a github.com repository.
If your company's account name is also - uses: Drjacky/github-profile-3d-contrib@0.7.1 # <- personal account repo.
env:
GITHUB_TOKEN: ${{ secrets.MY_COMPANY_PERSONAL_ACCESS_TOKEN }}
USERNAME: Drjacky # <- company account name |
The GraphQL endpoint for Github Enterprise is https://docs.github.com/en/enterprise-server@3.11/graphql/guides/forming-calls-with-graphql |
|
Correct. I tried this one as well and still... |
Looks like we cannot access Github Enterprise from Github.com; it still redirects the request to: Run Drjacky/github-business-profile-3d-contrib@0.7.2
AxiosError: Request failed with status code 401
at settle (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/0.7.2/dist/index.js:189199:12)
at IncomingMessage.handleStreamEnd (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/0.7.2/dist/index.js:19031[6](https://github.com/Drjacky/Drjacky/actions/runs/13738454743/job/38424924638#step:3:7):11)
at IncomingMessage.emit (node:events:531:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
at Axios.request (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/0.[7](https://github.com/Drjacky/Drjacky/actions/runs/13738454743/job/38424924638#step:3:8).2/dist/index.js:191426:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async fetchFirst (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/0.7.2/dist/index.js:1406:22)
at async Object.fetchData (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/0.7.2/dist/index.js:1445:1[8](https://github.com/Drjacky/Drjacky/actions/runs/13738454743/job/38424924638#step:3:9))
at async main (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/0.7.2/dist/index.js:1528:26) {
code: 'ERR_BAD_REQUEST',
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
adapter: [ 'xhr', 'http', 'fetch' ],
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: { FormData: [Function [FormData]], Blob: [class Blob] },
validateStatus: [Function: validateStatus],
headers: Object [AxiosHeaders] {
Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json',
Authorization: 'bearer ***',
'User-Agent': 'axios/1.8.1',
'Content-Length': '648',
'Accept-Encoding': 'gzip, compress, deflate, br'
},
method: 'post',
url: 'https://api.github.com/graphql',
data: '{"query":" query($login: String!)
.
.
.
data: {
message: 'Bad credentials',
documentation_url: 'https://docs.github.com/graphql',
status: '401'
}
},
status: 401 |
And I do have Actions in company's enterprise github but, when I run your Repo Action there, it stuck at Requested labels: self-hosted
Job defined at: mycompanyusername/mycompanyusername/.github/workflows/profile-3d.yml@refs/heads/main
Waiting for a runner to pick up this job... |
I looked at the repository and found two issues.
|
If by build, you mean release, yes, I did on every single change I had/tried on TS file. Does this work? -> I delete the previous release (and now there is no release) and create a new release But using the same TAG name and same ReleaseTitle. |
Nah, you're right. If I even delete the release and use the same Tag and same Title, it still has the old code. |
Now I'm using the last commit hash and still the same: Run Drjacky/github-business-profile-3d-contrib@bf2ce0ce278495d02d45252385a6df4a907c4e04
env:
GITHUB_TOKEN: ***
USERNAME: ***
SETTING_JSON: ./profile-[3](https://github.com/Drjacky/Drjacky/actions/runs/13738893509/job/38425822090#step:3:3)d-contrib/ever-green-custom.json
AxiosError: Request failed with status code [4](https://github.com/Drjacky/Drjacky/actions/runs/13738893509/job/38425822090#step:3:4)01
AxiosError: Request failed with status code 401
at settle (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/bf2ce0ce278495d02d45252385a[6](https://github.com/Drjacky/Drjacky/actions/runs/13738893509/job/38425822090#step:3:7)df4a907c4e04/dist/index.js:189199:12)
at IncomingMessage.handleStreamEnd (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/bf2ce0ce2[7](https://github.com/Drjacky/Drjacky/actions/runs/13738893509/job/38425822090#step:3:8)8495d02d45252385a6df4a907c4e04/dist/index.js:190316:11)
at IncomingMessage.emit (node:events:531:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:[8](https://github.com/Drjacky/Drjacky/actions/runs/13738893509/job/38425822090#step:3:9)2:21)
at Axios.request (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/bf2ce0ce278495d02d45252385a6df4a907c4e04/dist/index.js:191426:41)
at process.processTicksAndRejections (node:internal/process/task_queues:[9](https://github.com/Drjacky/Drjacky/actions/runs/13738893509/job/38425822090#step:3:10)5:5)
at async fetchFirst (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/bf2ce0ce278495d02d45252385a6df4a907c4e04/dist/index.js:1406:22)
at async Object.fetchData (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/bf2ce0ce278495d02d45252385a6df4a907c4e04/dist/index.js:1445:18)
at async main (/home/runner/work/_actions/Drjacky/github-business-profile-3d-contrib/bf2ce0ce278495d02d45252385a6df4a907c4e04/dist/index.js:1528:26) {
code: 'ERR_BAD_REQUEST',
.
.
.
method: 'post',
url: 'https://api.github.com/graphql',
data: '{"query":" query($login: String!)
data: {
message: 'Bad credentials',
documentation_url: 'https://docs.github.com/graphql',
status: '401'
}
},
status: 401 |
Github Actions cannot be run in TypeScript ( To build, you need to install tools such as node.js. Perhaps you don't have a build environment. I have now built a temporary modified version and made it accessible under the name - uses: yoshi389111/github-profile-3d-contrib@test-enterprise # <- changed
env:
GITHUB_TOKEN: ${{ secrets.MY_COMPANY_PERSONAL_ACCESS_TOKEN }}
USERNAME: company-account-name # <- your company account name
GITHUB_ENDPOINT: https://github.mycompany.com/api/graphql # or secrets <-- added
Note: This version will be removed later. Node: Fixed a typo: |
name: GitHub-Business-Profile-3D-Contrib
on:
schedule: # 03:00 JST == 18:00 UTC
- cron: "0 18 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
name: generate-github-business-profile-3d-contrib
steps:
- uses: actions/checkout@v3
- uses: yoshi389111/github-profile-3d-contrib@test-enterprise
env:
GITHUB_TOKEN: ${{ secrets.MY_COMPANY_PERSONAL_ACCESS_TOKEN }}
USERNAME: ${{ secrets.MY_COMPANY_USERNAME }}
GITHUB_ENDPINT: ${{ secrets.MY_COMPANY_ENDPOINT }}
SETTING_JSON: ./profile-3d-contrib/ever-green-custom.json
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: python ./bin/change-border.py profile-3d-contrib/profile-custom-evergreen.svg profile-3d-contrib/profile-custom-evergreen-with-border.svg
- name: Commit & Push
run: |
git config user.name github-actions
git config user.email github-actions@github.mycompany.com
git add -A .
git commit -m "3d-contrib generated"
git push Result: Run yoshi389111/github-profile-3d-contrib@test-enterprise
env:
GITHUB_TOKEN: ***
USERNAME: ***
GITHUB_ENDPINT:
SETTING_JSON: ./profile-[3](https://github.com/Drjacky/Drjacky/actions/runs/13738974265/job/38425975827#step:3:3)d-contrib/ever-green-custom.json
AxiosError: Request failed with status code [4](https://github.com/Drjacky/Drjacky/actions/runs/13738974265/job/38425975827#step:3:4)01
...
data: {
message: 'Bad credentials',
documentation_url: 'https://docs.github.com/graphql',
status: '401'
}
},
status: 401 |
Sorry, please fix the typo |
Same with: Run yoshi389111/github-profile-3d-contrib@test-enterprise
env:
GITHUB_TOKEN: ***
USERNAME: ***
GITHUB_ENDPOINT:
SETTING_JSON: ./profile-[3](https://github.com/Drjacky/Drjacky/actions/runs/13738990884/job/38426014149#step:3:3)d-contrib/ever-green-custom.json |
Can I use |
It worked. I forgot to add the secret to the profile Drjacky repo. 🎉 |
I'm glad that it worked. In the next version, 0.8.0, you will be able to set the Github Enterprise URL with the environment variable Please note that the current |
@Drjacky Please change
|
Is your feature request related to a problem? Please describe.
It might be; I'm not sure how to define the username if the user is on github enterprise.
Describe the solution you'd like
I want to set the action on my personal github(github.com) to generate the contribution chart for my work github(github.mycompany.com). My company's enterprise github doesn't support actions.
Describe alternatives you've considered
I created this workflow in the work github but for some reason, it doesn't access to the private repos. I tried to add GITHUB_TOKEN to secrets but github raised an error that secrets cannot start with
GITHUB_
. anyway, because my company's enterprise github doesn't support actions, I cannot generate the SVH over there.The text was updated successfully, but these errors were encountered: