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

GitHub Enterprise support #658

Merged
merged 6 commits into from
May 5, 2021
Merged

GitHub Enterprise support #658

merged 6 commits into from
May 5, 2021

Conversation

ZauberNerd
Copy link
Contributor

@ZauberNerd ZauberNerd commented May 4, 2021

This is a continuation of @catthehacker https://github.com/catthehacker/act-fork/tree/enterprise-github

  • We've updated the GHE URLs, because the API and GraphQL URLs are different on GHE than on github.com
  • We've updated the slug matching in common/git.go to match only the configured GHE instance

This is a draft for now, because we haven't tested it yet. We'll update and ping once we're ready to merge.

Closes #497

@mergify
Copy link
Contributor

mergify bot commented May 4, 2021

@ZauberNerd this pull request has failed checks 🛠

@mergify mergify bot added the needs-work Extra attention is needed label May 4, 2021
@KnisterPeter KnisterPeter mentioned this pull request May 5, 2021
@ZauberNerd ZauberNerd force-pushed the ghe-support branch 2 times, most recently from 2adc9b4 to e83cdcc Compare May 5, 2021 12:40
@ZauberNerd ZauberNerd marked this pull request as ready for review May 5, 2021 12:55
@ZauberNerd ZauberNerd requested a review from a team as a code owner May 5, 2021 12:55
@ZauberNerd
Copy link
Contributor Author

@cplee @catthehacker We've successfully executed act on our internal GHE and it works fine with the proposed changes.
Please review.

We are seeing one test failure in the powershell test but that seems also broken on master.

@cplee
Copy link
Contributor

cplee commented May 5, 2021

@ZauberNerd - tests shouldn't be failing on master - most recent PR from last night had all checks passing: https://github.com/nektos/act/pull/660/checks

@mergify
Copy link
Contributor

mergify bot commented May 5, 2021

@ZauberNerd this pull request has failed checks 🛠

@catthehacker
Copy link
Member

https://github.com/nektos/act/pull/658/checks?check_run_id=2510198377#step:6:2676

[remote-action-js/test]   ☁  git clone 'https:///actions/hello-world-javascript-action' # ref=v1
[remote-action-js/test]   cloning https:///actions/hello-world-javascript-action to /home/runner/.cache/act/actions-hello-world-javascript-action@v1
[remote-action-js/test] Unable to clone https:///actions/hello-world-javascript-action refs/heads/v1: Get "https:///actions/hello-world-javascript-action/info/refs?service=git-upload-pack": http: no Host in request URL
time="2021-05-05T14:35:53Z" level=debug msg="Get \"https:///actions/hello-world-javascript-action/info/refs?service=git-upload-pack\": http: no Host in request URL"
time="2021-05-05T14:35:53Z" level=debug msg="Get \"https:///actions/hello-world-javascript-action/info/refs?service=git-upload-pack\": http: no Host in request URL"
[remote-action-js/test]   ❌  Failure - actions/hello-world-javascript-action@v1
time="2021-05-05T14:35:53Z" level=debug msg="Get \"https:///actions/hello-world-javascript-action/info/refs?service=git-upload-pack\": http: no Host in request URL"
time="2021-05-05T14:35:53Z" level=debug msg="Get \"https:///actions/hello-world-javascript-action/info/refs?service=git-upload-pack\": http: no Host in request URL"
Error:     runner_test.go:71: assertion failed: error is not nil: Get "https:///actions/hello-world-javascript-action/info/refs?service=git-upload-pack": http: no Host in request URL: /home/runner/work/act/act/pkg/runner/testdata/remote-action-js
=== RUN   TestRunEvent/local-action-docker-url
time="2021-05-05T14:35:53Z" level=debug msg="Loading workflows from '/home/runner/work/act/act/pkg/runner/testdata/local-action-docker-url'"
time="2021-05-05T14:35:53Z" level=debug msg="Reading workflow '/home/runner/work/act/act/pkg/runner/testdata/local-action-docker-url/push.yml'"

@KnisterPeter
Copy link
Member

KnisterPeter commented May 5, 2021

The message below is obsolete: We found the error in the test setup.


@catthehacker

Locally I get this:

=== RUN   TestStepContextExecutor
=== RUN   TestStepContextExecutor/uses-and-run-in-one-step
*DRYRUN* [uses-and-run-in-one-step/test] 🚀  Start image=node:12.20.1-buster-slim
*DRYRUN* [uses-and-run-in-one-step/test]   🐳  docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
*DRYRUN* [uses-and-run-in-one-step/test] ⭐  Run Test
*DRYRUN* [uses-and-run-in-one-step/test]   ❌  Failure - Test
=== RUN   TestStepContextExecutor/uses-github-empty
*DRYRUN* [uses-github-empty/test] 🚀  Start image=node:12.20.1-buster-slim
*DRYRUN* [uses-github-empty/test]   🐳  docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
*DRYRUN* [uses-github-empty/test] ⭐  Run empty
*DRYRUN* [uses-github-empty/test]   ❌  Failure - empty
=== RUN   TestStepContextExecutor/uses-github-noref
*DRYRUN* [uses-github-noref/test] 🚀  Start image=node:12.20.1-buster-slim
*DRYRUN* [uses-github-noref/test]   🐳  docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
*DRYRUN* [uses-github-noref/test] ⭐  Run actions/checkout
*DRYRUN* [uses-github-noref/test]   ❌  Failure - actions/checkout
=== RUN   TestStepContextExecutor/uses-github-root
*DRYRUN* [uses-github-root/test] 🚀  Start image=node:12.20.1-buster-slim
*DRYRUN* [uses-github-root/test]   🐳  docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
*DRYRUN* [uses-github-root/test] ⭐  Run actions/checkout@v2
*DRYRUN* [uses-github-root/test]   ☁  git clone 'https:///actions/checkout' # ref=v2
*DRYRUN* [uses-github-root/test]   ✅  Success - actions/checkout@v2
=== RUN   TestStepContextExecutor/uses-github-path
*DRYRUN* [uses-github-path/test] 🚀  Start image=node:12.20.1-buster-slim
*DRYRUN* [uses-github-path/test]   🐳  docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
*DRYRUN* [uses-github-path/test] ⭐  Run sergioramos/yarn-actions/install@v6
*DRYRUN* [uses-github-path/test]   ☁  git clone 'https:///sergioramos/yarn-actions' # ref=v6
*DRYRUN* [uses-github-path/test]   ✅  Success - sergioramos/yarn-actions/install@v6
--- PASS: TestStepContextExecutor (0.88s)
    --- PASS: TestStepContextExecutor/uses-and-run-in-one-step (0.01s)
    --- PASS: TestStepContextExecutor/uses-github-empty (0.00s)
    --- PASS: TestStepContextExecutor/uses-github-noref (0.00s)
    --- PASS: TestStepContextExecutor/uses-github-root (0.45s)
    --- PASS: TestStepContextExecutor/uses-github-path (0.42s)
PASS
ok  	github.com/nektos/act/pkg/runner	0.891s

Since I'm new to go, can you give me a hint why this is failing on CI? I can't spot the difference in my setup.

ZauberNerd and others added 5 commits May 5, 2021 16:24
This change will allow use authentication for cloning actions
from private repositories or github enterprise instances.

Co-Authored-By: Markus Wolf <[email protected]>
@codecov
Copy link

codecov bot commented May 5, 2021

Codecov Report

Merging #658 (93d1653) into master (0f04942) will increase coverage by 0.44%.
The diff coverage is 51.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #658      +/-   ##
==========================================
+ Coverage   49.27%   49.71%   +0.44%     
==========================================
  Files          23       23              
  Lines        2401     2424      +23     
==========================================
+ Hits         1183     1205      +22     
  Misses       1090     1090              
- Partials      128      129       +1     
Impacted Files Coverage Δ
pkg/runner/runner.go 76.47% <ø> (ø)
pkg/common/git.go 55.50% <20.00%> (-4.30%) ⬇️
pkg/runner/step_context.go 71.09% <88.88%> (+2.14%) ⬆️
pkg/model/workflow.go 30.71% <100.00%> (+5.00%) ⬆️
pkg/runner/run_context.go 76.66% <100.00%> (+0.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 616d7fc...93d1653. Read the comment docs.

@mergify
Copy link
Contributor

mergify bot commented May 5, 2021

@ZauberNerd this pull request has failed checks 🛠

@catthehacker
Copy link
Member

Worked in CI now and works for me locally so I guess we can just call that one fail a fluke. LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-work Extra attention is needed size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Github Enterprise
4 participants