Skip to content

Commit

Permalink
Use CodeFlare machine user to push PR into OpenShift community operat…
Browse files Browse the repository at this point in the history
…ors repository
  • Loading branch information
sutaakar committed Jul 7, 2023
1 parent e04fbfa commit 34602ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tag-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
PREVIOUS_VERSION: ${{ github.event.inputs.replaces }}
INSTASCALE_VERSION: ${{ github.event.inputs.instascale-version }}
MCAD_VERSION: ${{ github.event.inputs.mcad-version }}
GH_TOKEN: ${{ secrets.GH_PAT }}
GH_TOKEN: ${{ secrets.CODEFLARE_MACHINE_ACCOUNT_TOKEN }}
IMAGE_ORG_BASE: quay.io/${{ github.event.inputs.quay-organization }}
OPERATORS_REPO_FORK_ORG: ${{ github.event.inputs.community-operators-prod-fork-organization }}
OPERATORS_REPO_ORG: ${{ github.event.inputs.community-operators-prod-organization }}
Expand All @@ -125,7 +125,7 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update dependency versions for release ${{ github.event.inputs.version }}
file_pattern: 'README.md controllers/defaults.go *.yaml *.tmpl Makefile'
file_pattern: 'README.md controllers/defaults.go *.yaml Makefile'

- name: Creates a release in GitHub
run: |
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ bundle-push: ## Push the bundle image.

.PHONY: openshift-community-operator-release
openshift-community-operator-release: install-gh-cli bundle ## build bundle and create PR in OpenShift community operators repository
git clone https://$(GH_TOKEN)@github.com/$(OPERATORS_REPO_FORK_ORG)/community-operators-prod.git
git clone https://x-access-token:$(GH_TOKEN)@github.com/$(OPERATORS_REPO_FORK_ORG)/community-operators-prod.git
cd community-operators-prod && git remote add upstream https://github.com/$(OPERATORS_REPO_ORG)/community-operators-prod.git && git pull upstream main && git push origin main
cp -r bundle community-operators-prod/operators/codeflare-operator/$(BUNDLE_VERSION)
cd community-operators-prod && git checkout -b codeflare-release-$(BUNDLE_VERSION) && git add operators/codeflare-operator/$(BUNDLE_VERSION)/* && git commit -m "add bundle manifests codeflare version $(BUNDLE_VERSION)" && git push origin codeflare-release-$(BUNDLE_VERSION)
gh pr create --repo $(OPERATORS_REPO_FORK_ORG)/community-operators-prod --title "CodeFlare $(BUNDLE_VERSION)" --body "New release of codeflare operator" --head $(OPERATORS_REPO_ORG):codeflare-release-$(BUNDLE_VERSION) --base main
gh pr create --repo $(OPERATORS_REPO_ORG)/community-operators-prod --title "CodeFlare $(BUNDLE_VERSION)" --body "New release of codeflare operator" --head $(OPERATORS_REPO_FORK_ORG):codeflare-release-$(BUNDLE_VERSION) --base main
rm -rf community-operators-prod

.PHONY: opm
Expand Down

0 comments on commit 34602ce

Please sign in to comment.