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

release fails if gh-pages branch doesn't yet exist #10

Open
paulczar opened this issue Feb 3, 2020 · 3 comments
Open

release fails if gh-pages branch doesn't yet exist #10

paulczar opened this issue Feb 3, 2020 · 3 comments

Comments

@paulczar
Copy link

paulczar commented Feb 3, 2020

the cr.sh script creates the worktree for gh-pages branch fails when the gh-pages doesn't yet exist.

We should add some logic to check if it exists, and if not, add it, rather than fail

https://github.com/helm/chart-releaser-action/blob/master/cr.sh#L217

@chrissng
Copy link

In the meanwhile one could add this step in GH action for pull request (e.g. linting your chart):

      - name: Check for gh-pages branch
        run: |
          git ls-remote --exit-code --heads origin gh-pages

SamuAlfageme added a commit to SamuAlfageme/owncloudcharts that referenced this issue May 19, 2020
- This requires a 'gh-pages' branch present on the remote:
helm/chart-releaser-action#10
- Requires a CR_TOKEN secret to be defined with push
permissions withing the GitHub repo that runs on.
- Publishes the helm repo with github pages, so it can
be consumed with:
helm repo add owncloud https://owncloud.github.io/charts
Knappek added a commit to prometheus-msteams/prometheus-msteams that referenced this issue Sep 17, 2020
@invidian
Copy link

invidian commented Apr 5, 2021

In the meanwhile one could add this step in GH action for pull request (e.g. linting your chart):

I'm not sure how this helps, it just shifts the failure from later stage to early. It would be nice to have documented how to create this branch.

@thetredev
Copy link

thetredev commented Feb 12, 2023

My workaround:

- name: Configure Git
  run: |
    git config user.name "$GITHUB_ACTOR"
    git config user.email "$GITHUB_ACTOR@users.noreply.github.com"

- name: Create gh-pages branch if it doesn't exist
  continue-on-error: true
  run: |
    git checkout -b gh-pages || exit 1
    git rebase main
    git push origin gh-pages

    git checkout main

- name: Run chart-releaser
  uses: helm/chart-releaser-action@v1.5.0
  env:
    CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}

But I think this is very ugly... I'll probably do my own thing instead. This action is not what I expected tbh..

Edit: To my surprise it works quite well once you get the hang of it.
Edit 2: Updated the code, because the old solution overwrote the gh-pages branch.

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

No branches or pull requests

4 participants