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

v2.5.0 is giving an error of targetBranch main does not exist #133

Closed
jessebot opened this issue Oct 31, 2023 · 14 comments
Closed

v2.5.0 is giving an error of targetBranch main does not exist #133

jessebot opened this issue Oct 31, 2023 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@jessebot
Copy link

jessebot commented Oct 31, 2023

After #132 was fixed (which it was for me), I seem to be seeing the following error with my job:

Run changed=$(ct list-changed --target-branch main)
  changed=$(ct list-changed --target-branch main)
  if [[ -n "$changed" ]]; then
    echo "changed=true" >> "$GITHUB_OUTPUT"
  fi
  shell: /usr/bin/bash -e {0}
  env:
    CT_CONFIG_DIR: /opt/hostedtoolcache/ct/3.9.0/amd64/etc
    VIRTUAL_ENV: /opt/hostedtoolcache/ct/3.9.0/amd64/venv
Error: targetBranch 'main' does not exist
Error: Process completed with exit code 1.
Here is my full workflow file
name: Lint and Test Chart

on:
pull_request:
  paths:
    - 'charts/matrix/**'

permissions:
contents: read

jobs:
lint:
  name: Lint
  runs-on: ubuntu-latest
  steps:
    - name: Checkout
      uses: actions/checkout@v4
      with:
        fetch-depth: "0"

    - name: Install Helm
      uses: azure/[email protected]

    - name: Add dependency chart repos
      run: |
        helm repo add bitnami https://charts.bitnami.com/bitnami
        helm repo add coturn https://jessebot.github.io/coturn-chart

    - name: Set up chart-testing
      uses: helm/[email protected]

    - name: Run chart-testing (list-changed)
      id: list-changed
      run: |
        changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
        if [[ -n "$changed" ]]; then
          echo "changed=true" >> "$GITHUB_OUTPUT"
        fi

    - name: Run chart-testing (lint)
      id: lint
      if: steps.list-changed.outputs.changed == 'true'
      run: ct lint --target-branch ${{ github.event.repository.default_branch }}

In my own repos, I have moved forward, so this probably won't affect me personally for another week or two, but if I understand correctly, this is also affecting others.

Previous comments pertaining to this issue just for record:
#132 (comment)
#132 (comment)

@Eusebiotrigo
Copy link

Eusebiotrigo commented Oct 31, 2023

Happening the same over here.

Seems to be related to helm/chart-testing#577 and helm/chart-testing#601

I thought I was getting mad about this output.

@cpanato
Copy link
Member

cpanato commented Oct 31, 2023

@jessebot i will try to figure out what is going on today, but be kind i do that in my free time

@tboerger
Copy link

You are doing a great job @cpanato, thanks for your effort! ;)

@eyenx
Copy link

eyenx commented Oct 31, 2023

Thanks for your effort @cpanato !

jakoberpf added a commit to jakoberpf/charts that referenced this issue Oct 31, 2023
@jessebot
Copy link
Author

jessebot commented Oct 31, 2023

@jessebot i will try to figure out what is going on today, but be kind i do that in my free time

Thanks for your hard work, friend! Updated my language, sorry for my tone 💙

@stevehipwell
Copy link

I suspect that this issue might be caused by helm/chart-testing#511; I'm just running a test to revert the ct binary back to v3.8.0 to see if that fixes the issue.

@stevehipwell
Copy link

I can confirm that setting version: v3.8.0 in the with block fixes the error by reverting the ct version.

@patrick-stephens
Copy link

thanks @stevehipwell for being everywhere I need you :)
I can confirm this is working for us now as well:

      - name: Set up chart-testing
        uses: helm/[email protected]
        with:
          version: v3.8.0

@cpanato
Copy link
Member

cpanato commented Oct 31, 2023

ack, this helm/chart-testing#601 should fix the issue, already tested the main branch here https://github.com/cpanato/testing-ci-providers/actions/runs/6707913084/job/18227518159?pr=1839 and seems to work again

running a v3.10.0 release and will update the action soon

@cpanato cpanato self-assigned this Oct 31, 2023
@cpanato cpanato added the bug Something isn't working label Oct 31, 2023
@cpanato
Copy link
Member

cpanato commented Oct 31, 2023

ok this https://github.com/helm/chart-testing/releases/tag/v3.10.0 and the chart-testing-action release https://github.com/helm/chart-testing-action/releases/tag/v2.6.0 should fix this issue

a test run here: https://github.com/cpanato/testing-ci-providers/actions/runs/6708194049/job/18228414875?pr=1839

@srinath92
Copy link

srinath92 commented Jun 12, 2024

Hello,

I'm still seeing the problem and the error says origin/main doesn't exist.

image

Below is the config that I've. Any ideas on what I'm missing please?

workflow.yaml:

image

ct.yaml

image

carlosrodfern added a commit to roflcoopter/viseron-helm-chart that referenced this issue Jul 13, 2024
@LazyKeru
Copy link

LazyKeru commented Sep 3, 2024

@srinath92 Can you show how you checkout the git repo ? I had the same issue, however I just forgot to set the git checkout with the option fetch-depth: 0. Now everything is working as normal

@sonnysideup
Copy link

chart-testing-action: v2.6.1
ct: v3.10.1

I can verify that omitting fetch-depth: 0 from the checkout action will result in this error. Adding that argument resolves the issue for me.

@cpanato
Copy link
Member

cpanato commented Oct 14, 2024

you need the fetch-depth: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants