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

ci(test): run on pull request and add concurrency configuration #17

Merged
merged 7 commits into from
Aug 24, 2023

Conversation

parkerbxyz
Copy link
Contributor

@parkerbxyz parkerbxyz commented Aug 22, 2023

  • Run test on pull requests to the main branch instead of on every push
  • Cancel in-progress workflows if a PR is updated (i.e., a new commit is pushed) and the same workflows are triggered to run again
  • Rename step ID from demo to test

This will cancel in-progress workflows if a PR is updated (i.e., a new commit is pushed) and the same workflows are triggered to run again. This reduces unnecessary compute time.
@parkerbxyz parkerbxyz self-assigned this Aug 22, 2023
@parkerbxyz parkerbxyz requested a review from gr2m as a code owner August 22, 2023 03:58
@parkerbxyz parkerbxyz changed the title ci(test): run on pull request to main and add concurrency ci(test): run on pull request to main and add concurrency configuration Aug 22, 2023
@parkerbxyz parkerbxyz changed the title ci(test): run on pull request to main and add concurrency configuration ci(test): run on pull request and add concurrency configuration Aug 22, 2023
.github/workflows/test.yml Outdated Show resolved Hide resolved
Co-authored-by: Gregor Martynus <[email protected]>
@parkerbxyz parkerbxyz marked this pull request as draft August 22, 2023 16:01
@gr2m
Copy link
Contributor

gr2m commented Aug 22, 2023

for reference, we are reviewing potential security vulnerabilities when using pull_request_target:
https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

Comment on lines 2 to 4
on:
pull_request:
branches: [main]
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd still keep this part

Suggested change
on:
pull_request:
branches: [main]
push:
branches:
- main
pull_request: {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it because pull request checks run in the context of the merge commit, so running on push to main is redundant. Is there another use case you have in mind?

Copy link
Contributor

Choose a reason for hiding this comment

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

I always thought that the push to main builds and the pull requests builds were slightly different but maybe this is no longer the case.

The other reason is if we want to add a badge showing that the CI passes, not sure if we could show a badge if we don't run test builds on the main branch?

@parkerbxyz parkerbxyz marked this pull request as ready for review August 24, 2023 22:29
@parkerbxyz parkerbxyz requested a review from a team as a code owner August 24, 2023 22:29
@parkerbxyz parkerbxyz merged commit 4fd0ce7 into main Aug 24, 2023
4 checks passed
@parkerbxyz parkerbxyz deleted the parkerbxyz/test-workflow branch August 24, 2023 22:30
@create-app-token-action-releaser

🎉 This PR is included in version 1.1.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants