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

fix(ci): do not delete instances from main branch on merge #4206

Merged
merged 2 commits into from
Apr 26, 2022

Conversation

gustavovalverde
Copy link
Member

@gustavovalverde gustavovalverde commented Apr 26, 2022

Motivation

We were never expecting the ref from a pull_request event would get mixed with the base branch at some point when using:

on:
  workflow_dispatch:
  pull_request:
    branches:
      - main
    types: [closed]

The closed type pulls refs from the base branch instead of the PR branch, causing this workflow to delete instances containing main in the name, instead of the PR name.

Solution

  • Change GITHUB_REF_SLUG_URL with GITHUB_HEAD_REF_SLUG_URL to use the head branch from the PR instead of the PR ref, as (at this point) the PR is already merged.

  • Delete the clean.yml workflow

Actually closes #3991, the previous PR #4198 didn't fix it, but it provided better diagnostics.

Review

@dconnolly or @teor2345 can review this

Follow Up Work

Later evaluate if automating instance deletion is required, and under which circumstances.

This was creating an unintended behavior, and so far instances are being cleaned up in its corresponding workflow.
@gustavovalverde gustavovalverde added C-bug Category: This is a bug A-devops Area: Pipelines, CI/CD and Dockerfiles P-Critical 🚑 I-integration-fail Continuous integration fails, including build and test failures labels Apr 26, 2022
@gustavovalverde gustavovalverde requested a review from a team as a code owner April 26, 2022 22:38
@gustavovalverde gustavovalverde self-assigned this Apr 26, 2022
@gustavovalverde gustavovalverde requested review from conradoplg and removed request for a team April 26, 2022 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-devops Area: Pipelines, CI/CD and Dockerfiles C-bug Category: This is a bug I-integration-fail Continuous integration fails, including build and test failures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"unexpected EOF" causes Google Cloud workflows to fail
3 participants