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

handle when action triggered on a PR from a fork #6

Open
a-b-r-o-w-n opened this issue Dec 4, 2019 · 6 comments
Open

handle when action triggered on a PR from a fork #6

a-b-r-o-w-n opened this issue Dec 4, 2019 · 6 comments

Comments

@a-b-r-o-w-n
Copy link
Owner

Things to consider:

  • add logging
  • still run linter
  • output results to console instead of creating annotations
@arikfr
Copy link

arikfr commented Dec 5, 2019

You can't add annotations when the PR comes from a fork?

@a-b-r-o-w-n
Copy link
Owner Author

Unfortunately no. GitHub only gives forks a read only token to make api requests including status checks.

@arikfr
Copy link

arikfr commented Dec 5, 2019

Bummer. Makes it less useful for Open Source projects.

@a-b-r-o-w-n
Copy link
Owner Author

Agreed. Actions are still in the early stages so at some point there might be a way to do this.

Another bummer is that any secret managed by github is not provided to actions when run from a fork. This is to prevent malicious actors from using the secret (since the fork can modify the action steps that get invoked).

@jnm2
Copy link

jnm2 commented Mar 31, 2021

If you write workflow commands to stdout instead of making web API calls which depend on the token, the authentication issue goes away and the performance may even be better.

Example from docs page (https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message):

echo "::warning file=app.js,line=1,col=5::Missing semicolon"

Both warning and error annotations can be created this way. A GitHub action using this approach: https://github.com/cschleiden/jest-github-actions-reporter

@a-b-r-o-w-n
Copy link
Owner Author

@jnm2 this is a great idea. I'll see about making this change soon.

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

Successfully merging a pull request may close this issue.

3 participants