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: disable running CI for releases #1671

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

jordigh
Copy link
Contributor

@jordigh jordigh commented Jun 12, 2023

Description

Please provide a brief description of the changes introduced in this pull request.
What problem does it solve? What is the context of this change?

There are a few parts to this:

  1. First, disable running on pushes. This is because pushes don't have context when they come from a pull request. In particular, pushes don't have the branch name the pull request came from.

  2. At the same time, enable running on synchronize and close actions on pull_request events. This will ensure that when a PR gets updated or merged, we'll see a CI run. This changes the default actions of only running on opened, synchronize, or reopened.

  3. Then, disable running if the branch name starts with release.

  4. In the same condition check, enable runs only for branches that are closed via a merge. We don't want to trigger CI for a PR that is closed because we decided to abandon the idea.

How to Test

Scenarios in my test repo, when running PRs from a fork:

Note: this test repo has no secrets, which explains the CI failures.

Related Issues

@bizob2828 bizob2828 changed the title fix: disable running CI for releases ci: disable running CI for releases Jun 12, 2023
@jordigh jordigh force-pushed the disable-ci-for-releases branch from cf7bda4 to 0ac9131 Compare June 12, 2023 20:57
@codecov
Copy link

codecov bot commented Jun 12, 2023

Codecov Report

Merging #1671 (1e87593) into main (76d3ade) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1671   +/-   ##
=======================================
  Coverage   96.87%   96.87%           
=======================================
  Files         200      200           
  Lines       39180    39180           
  Branches       24       24           
=======================================
  Hits        37955    37955           
  Misses       1225     1225           
Flag Coverage Δ
esm-unit-tests-14.x 47.80% <ø> (ø)
esm-unit-tests-16.x 92.11% <ø> (ø)
esm-unit-tests-18.x 92.11% <ø> (ø)
integration-tests-14.x 78.98% <ø> (ø)
integration-tests-16.x 79.08% <ø> (ø)
integration-tests-18.x 79.08% <ø> (ø)
unit-tests-14.x 91.41% <ø> (ø)
unit-tests-16.x 91.46% <ø> (ø)
unit-tests-18.x 91.44% <ø> (ø)
versioned-tests-14.x 75.70% <ø> (-0.06%) ⬇️
versioned-tests-16.x 77.03% <ø> (-0.06%) ⬇️
versioned-tests-18.x 77.03% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jordigh jordigh force-pushed the disable-ci-for-releases branch from 0ac9131 to 088a8af Compare June 14, 2023 16:12
@jmartin4563 jmartin4563 self-assigned this Jun 16, 2023
@jmartin4563 jmartin4563 added the dev:automation Indicates CI automation label Jun 20, 2023
Copy link
Contributor

@jmartin4563 jmartin4563 left a comment

Choose a reason for hiding this comment

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

Ran through the test scenarios on my personal fork, just one thought about getting rid of a conditional I think we can drop.

.github/workflows/ci-workflow.yml Outdated Show resolved Hide resolved
1) First, disable running on pushes. This is because pushes don't have
context when they come from a pull request. In particular, pushes
don't have the branch name the pull request came from.

2) Then, disable running if the branch name starts with release.

3) In the same condition check, enable runs only for branches that are
closed via a merge. We don't want to trigger CI for a PR that is
closed because we decided to abandon the idea.


fix: remove unnecessary conditional
@jordigh jordigh force-pushed the disable-ci-for-releases branch from 20e20a4 to 1e87593 Compare June 20, 2023 19:19
@jmartin4563 jmartin4563 self-requested a review June 20, 2023 19:20
Copy link
Contributor

@jmartin4563 jmartin4563 left a comment

Choose a reason for hiding this comment

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

🎉

@jordigh jordigh merged commit 3dc4385 into newrelic:main Jun 21, 2023
@jordigh jordigh deleted the disable-ci-for-releases branch June 21, 2023 15:14
@github-actions github-actions bot mentioned this pull request Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev:automation Indicates CI automation
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants