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 reusable workflow from GHES #389

Open
anilkeshav27 opened this issue Aug 26, 2024 · 1 comment
Open

github reusable workflow from GHES #389

anilkeshav27 opened this issue Aug 26, 2024 · 1 comment

Comments

@anilkeshav27
Copy link

hi, this is more a question and you can point me to any docu which will help me. trying to call a reusable workflow that is in GHES . trying to call it with
Runner.Client --event push --workflow someWorkflow.yml -P ubuntu-latest=-self-hosted --git-server-url=https://<GHES-url> --git-api-server-url=https://<GHES-url>/api/v3

inside someWorkflow.yml i have a call to reusable workflow that lives in GHES
uses: org/repo/.github/workflows/reusable_workflow.yml@main

there must also be a token to access the GHES and --github-connect-token seems to be a token for github.com, but where do i provide the token for GHES,

currently my test fails with
Failed to instantiate Workflow: No such callable workflow:

so how do i call a reusable workflow from GHES ?

@ChristopherHX
Copy link
Owner

ChristopherHX commented Aug 26, 2024

You should be able to provide your instance token via -s GITHUB_TOKEN=<token>.

GITHUB_TOKEN is a secret like any other in this program.

To avoid putting the secret in your cli parameter, configure it to use secret files

secrets.yml

GITHUB_TOKEN: <pat>

and
--secret-file secrets.yml is another method, then put the secrets.yml in your gitignore.

Additionally if you want to get rid of cli flags, create an .actrc file in you current working dir with content (each cli flag key value pair in a single line, no quotes)

--secret-file secrets.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@anilkeshav27 @ChristopherHX and others