Skip to content

Commit

Permalink
Submit PR instead of merging directly to main
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkpickering committed Mar 8, 2024
1 parent 842be8e commit e9528bf
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,21 @@ jobs:
bin/partner-charts-ci auto
git push origin main-source
- name: Update main branch
- name: Create PR to update main branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_WORKFLOW: ${{ github.workflow }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
# checkout action only fetches main-source, so we need to fetch main branch also
git fetch origin main --depth 1
git checkout main
git checkout main-source -- index.yaml assets
git commit -m "Release partner charts"
git push origin main
UPDATE_BRANCH="auto-update/$(date '+%s')"
git checkout -b "$UPDATE_BRANCH"
git rm -r assets index.yaml
git checkout main-source -- assets index.yaml
git commit -m "Update partner charts"
git push --set-upstream origin "$UPDATE_BRANCH"
TITLE="Update partner charts"
BODY="This PR was created by workflow \"$GITHUB_WORKFLOW\"."
gh pr create --repo "$GITHUB_REPOSITORY" --base main --head "$UPDATE_BRANCH" --title "$TITLE" --body "$BODY"

0 comments on commit e9528bf

Please sign in to comment.