Skip to content

Commit

Permalink
Update .push-helm-chart.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
barrfalk committed Jan 9, 2024
1 parent 55e0f22 commit 378c477
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/.push-helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ jobs:
ssh-key: ${{ secrets.MANIFEST_REPO_DEPLOY_KEY }}
path: 'target-repo'

- name: Create new branch or checkout existing branch in target repository
- name: Create or Checkout Existing Branch in Target Repository
run: |
cd target-repo
BRANCH_NAME="update-helm-chart-${{ env.package_tag }}"
git fetch origin
if git rev-parse --verify origin/$BRANCH_NAME; then
git checkout $BRANCH_NAME
git pull origin $BRANCH_NAME
git merge origin/$BRANCH_NAME -X ours
else
git checkout -b $BRANCH_NAME
fi
Expand All @@ -116,7 +117,7 @@ jobs:
git config --global user.name "${{ vars.GLOBAL_USER}}"
git config --global user.email "${{ vars.GLOBAL_EMAIL}}"
git add .
git commit -m "update helm chart ${{ inputs.tag }}"
git commit -m "update helm chart ${{ inputs.tag }}" || true # Avoids failure if there's nothing to commit
git push --set-upstream origin update-helm-chart-${{ inputs.tag }}
- name: Create Pull Request
Expand Down

0 comments on commit 378c477

Please sign in to comment.