Skip to content

Conversation

AlexWaygood
Copy link
Member

I'm currently getting a daily email informing me that the pyperformance tests failed on the AlexWaygood/pyperformance repo (because I enabled workflows for my fork). This PR makes it so that the test workflow only happens on python/pyperformance, not on contributors' forks of the repo (unless they specifically request the workflow by manually triggering the workflow or by making a PR to their fork).

We use a condition like this in our typeshed workflow here, and it works great: https://github.com/python/typeshed/blob/ae0c9f9dadd72ee823d289416943a9109e24fe52/.github/workflows/daily.yml#L33

I'm currently getting a daily email informing me that the pyperformance tests failed on the `AlexWaygood/pyperformance` repo (because I enabled workflows for my fork). This PR makes it so that the `test` workflow only happens on `python/pyperformance`, not on contributors' forks of the repo (unless they specifically request the workflow by manually triggering the workflow or by making a PR to their fork).
@hugovk
Copy link
Member

hugovk commented May 1, 2023

Good idea!

if: ${{ github.repository == 'python/pyperformance' || github.event_name != 'schedule' || github.event_name != 'pull_request' }}

So does that mean run:

  • on anything for upstream
    OR
  • on non-schedule triggers (== push/pull_request/workflow_dispatch) for upstream/forks
    OR
  • on non-pull_request triggers (== push/schedule/workflow_dispatch) for upstream/forks

Which means it will still run the full set of four triggers for forks?

image


This discussion says:

Currently, to disable running scheduled jobs for contributors, each job needs to be annotated with this.

if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'arduino/arduino-cli')

So run:

  • on any non-schedule triggers (== push/pull_request/workflow_dispatch) for upstream/forks
    OR
  • on schedule triggers for upstream

Is that what we're after?

image

@AlexWaygood
Copy link
Member Author

Ah, good catch, I completely screwed up the logic here!

@AlexWaygood AlexWaygood requested a review from hugovk May 1, 2023 09:56
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@AlexWaygood AlexWaygood merged commit 9641307 into main May 1, 2023
@AlexWaygood AlexWaygood deleted the AlexWaygood-scheduled-tests branch May 1, 2023 10:27
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 this pull request may close these issues.

2 participants