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

GHA: Limit operations to main branch only #1175

Merged
merged 1 commit into from
Oct 6, 2022

Conversation

cevich
Copy link
Member

@cevich cevich commented Oct 6, 2022

Due to it's design, github-actions workflows source their configuration from different locations depending on the event-type. This is impossible for humans to manage, let alone on repos with multiple release-branches. One would need to:

  1. Understand the config-source for all utilized trigger events.
  2. Ensure upon creation of a new branch or tag, the relevant source is updated to support reliable long-term operations.
  3. Repeat for infinity.

Fix this by removing all GHA trigger events except pull_request. For all pull requests, only trigger code validation if the target is main.

Also, for push (merge) events, limit validation to main to prevent (new) validate from trying to run against (old) release branches - it will fail.

Due to it's design, github-actions workflows source their configuration
from different locations depending on the event-type.  This is
impossible for humans to manage, let alone on repos with multiple
release-branches.  One would need to:

1. Understand the config-source for all utilized trigger events.
2. Ensure upon creation of a new branch or tag, the relevant source
   is updated to support reliable long-term operations.
3. Repeat for infinity.

Fix this by removing all GHA trigger events except `pull_request`.  For
all pull requests, only trigger code validation if the target is `main`.

Also, for `push` (merge) events, limit validation to `main` to prevent
(new) validate from trying to run against (old) release branches - it
will fail.

Signed-off-by: Chris Evich <cevich@redhat.com>
@mheon
Copy link
Member

mheon commented Oct 6, 2022

LGTM

@Luap99 @baude @rhatdan Let's get this merged

@Luap99
Copy link
Member

Luap99 commented Oct 6, 2022

/lgtm

@mheon
Copy link
Member

mheon commented Oct 6, 2022

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 6, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cevich, mheon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Oct 6, 2022
@openshift-merge-robot openshift-merge-robot merged commit 83e6ec8 into containers:main Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants