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

Try refining Run Tests GitHub Action again #8

Merged
merged 1 commit into from
Nov 26, 2023

Conversation

mbland
Copy link
Owner

@mbland mbland commented Nov 25, 2023

PR #7 triggered the Run Tests action again, but did so multiple times.

I want all pushes to main to trigger builds, as well as updates to pull requests, but not pushes to other branches. And I want each action to run only once per PR.

This is an attempt to get the right thing to happen based on advice from:

PR #7 triggered the Run Tests action again, but did so multiple times.

I want all pushes to `main` to trigger builds, as well as updates to
pull requests, but not pushes to other branches. And I want each action
to run only once per PR.

This is an attempt to get the right thing to happen based on advice
from:

- https://stackoverflow.com/a/65096459
- https://github.com/orgs/community/discussions/26276#discussioncomment-3251140
@mbland
Copy link
Owner Author

mbland commented Nov 26, 2023

This change causes Run Tests to ignore paths starting with .*, so the actions won't run on this PR. Merging.

@mbland mbland merged commit 441c274 into main Nov 26, 2023
@mbland mbland deleted the github-actions-refinements branch November 26, 2023 00:01
mbland added a commit that referenced this pull request Nov 26, 2023
The Run Tests `if:` conditional from #8 didn't allow #9 to run, because
it excluded still opened pull requests. So now it should run:

- On 'push' events on `main`
- On any events from open 'pull_request' against `main` (specifically
  opened, synchronize, and reopened)
- On any closed 'pull_request' event resulting in a merge into `main`

I also realized that including the "edited" action type didn't actually
make a lot of sense for my purposes.

For reference:

- https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
- https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request
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.

None yet

1 participant