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

Do not run GitHub Action Workflows on fork of example repository #3539

Closed
lovettbarron opened this issue Sep 6, 2020 · 8 comments · Fixed by prisma/prisma-examples#1999
Closed
Assignees
Labels
kind/feedback Issue for gathering feedback. topic: tests
Milestone

Comments

@lovettbarron
Copy link

Problem

I started a new Prisma project to test out Prisma2 by building on this example. As I was working on the project, I started getting Github Action errors saying that my allotted actions were being used up — within a few days hitting 100%. I hadn't realized it but Prisma was creating a bunch of actions that were running almost constantly.

I'm not sure where in the documentation this lives, but since it impacts a paid feature on Github (and sucked my resources dry so quickly), this should probably be flagged at some point during the database initialization phase. I've searched through the documentation for this, but wasn't able to find it using the action names and similar.

Screen Shot 2020-09-06 at 13 14 28

Suggested solution

  • Explicit callout or setting when seeding the database.
  • Required and explicit statement in the schema.
  • Reference the need for github actions in the example documentation

Additional context

A buddy works on the Github Actions team, so I'll be chatting with him about this next week (as well as passing on this issue) to see if he has any suggestions.

@janpio janpio self-assigned this Sep 7, 2020
@janpio
Copy link
Member

janpio commented Sep 7, 2020

Hi @readywater, that is definitely not intended from our side. Sorry.

We use Github Actions to run automation on the examples repository so it is always up to date with our latest development version of Prisma, and automatically run a large suite of integration tests. We did unfortunately not anticipate that this would also run in user forks of this repository, so never thought about how to avoid that.

The developers that built this automation are now already looking into how to avoid this in the future. To make sure you do not get any more costs or lose more quota, best remove the workflows for your fork in the .github folder.

Please also contact me at piotrowski@prisma.io for reimbursement of the GH Actions cost that you would now possible get because these Actions runs used up your quota.

@janpio janpio added topic: tests kind/feedback Issue for gathering feedback. labels Sep 7, 2020
@lovettbarron
Copy link
Author

Thanks @janpio, no worries on the reimbursement. Grateful for the work you all are doing on the Prisma infrastructure and been proud to build Knowsi on top of it. Thanks for the explanation!

@janpio janpio changed the title Explicitly Define Github actions Do not run GitHub Action Workflows on fork of example repository Sep 7, 2020
@janpio janpio added this to the Backlog 2.7.0 milestone Sep 7, 2020
@janpio
Copy link
Member

janpio commented Sep 7, 2020

Seems there is no built in option to disable Github Actions workflows for forks automatically on Github.

So the most promising option for us it to a) either completely change how we run our "update Prisma dependencies" workflows (and possibly put them in a separate repository, bot or even CI provider or b) adapt our workflows to only be run in the prisma org (similar to https://github.community/t/stop-github-actions-running-on-a-fork/17965/2). We'll probably opt for b) for now and see if this makes it work and acceptable for users (we are not 100% sure yet if this leads to no minute quota usage yet or not).

@chrispat
Copy link

chrispat commented Sep 8, 2020

One option might be to put a condition on each job if: github.owner == prisma which would at least prevent the jobs for actually running on a VM for repos outside the prisma org.

@janpio
Copy link
Member

janpio commented Sep 9, 2020

While experimenting with something else, I got this message on a repository fork that had already included GitHub Actions workflow files:

image

Did you get the same error message @readywater? That would mean that most users will look at the workflow definitions and we can possibly also add a README there or a comment in the workflow file to make this more prominent and include instructions to delete the update workflow.

@steebchen
Copy link
Contributor

@chrispat Thanks, but this doesn't seem to work: prisma/prisma-examples#1999. Am I doing something wrong? I tried if github.owner == prisma on a workflow level, and then tried github.repository_owner == prisma because I could only find the latter in the docs, but neither of them triggered a workflow.

@chrispat
Copy link

You are right it is github.repository_owner. We do not currently support the if condition on the workflow level so you would need to put it on each job.

@steebchen
Copy link
Contributor

steebchen commented Sep 10, 2020

@chrispat Actually it works! I actually meant job, not workflow. The reason it didn't work was that we weren't using quotes though, so github.repository_owner == 'prisma' did the trick.

@janpio janpio modified the milestones: Backlog 2.7.0, Release 2.7.0 Sep 10, 2020
polm added a commit to polm/spaCy that referenced this issue Jul 10, 2021
The autoblack job is an occasional cleanup job. If it runs on forks and
those PRs are accepted the git history will be weird and that doesn't
help anyone.

The way to make the job not run on forks is a little non-obvious but
based on this thread.

prisma/prisma#3539
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feedback Issue for gathering feedback. topic: tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants