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

how to run the workflow on forks #6

Open
Karim-53 opened this issue Jan 4, 2023 · 1 comment
Open

how to run the workflow on forks #6

Karim-53 opened this issue Jan 4, 2023 · 1 comment

Comments

@Karim-53
Copy link

Karim-53 commented Jan 4, 2023

Hi

the secret token is not passed to PR based on forks

##[debug]....Evaluating String:
##[debug]....=> 'token'
##[debug]..=> ''
##[debug]=> 'sourcery login --token 
##[debug]'
##[debug]Result: 'sourcery login --token 
##[debug]'
##[debug]Loading env
Run sourcery login --token 
  sourcery login --token 
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.10.9/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.9/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.9/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.9/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.9/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.9/x64/lib
##[debug]/usr/bin/bash --noprofile --norc -e -o pipefail /home/runner/work/_temp/bb6c9ab8-c01e-48d9-9315-ce093cdd696f.sh
Error: Option '--token' requires an argument.
Error: Process completed with exit code 2.

this is because Secrets are not passed to workflows that are triggered by a pull request from a fork. [Learn more about encrypted secrets](https://docs.github.com/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets).

I tried on: pull_request_target but it does not work... https://github.com/Karim-53/Compare-xAI/blob/main/.github/workflows/sourcery.yml

https://github.com/Karim-53/Compare-xAI/actions/runs/3742105178

plz help

@namurphy
Copy link

I'm getting a similar error on PlasmaPy/PlasmaPy#2220, which includes:

Error: Option '--token' requires an argument.

I made a pull request from a fork, and set up SOURCERY_TOKEN on the primary repo. I'll try to post here or on that PR if I figure out what the issue is. (I might try setting the token on my fork as well.)

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

2 participants