Skip to content

Commit

Permalink
fix: pushing olm bundles to github was failing due to missing credent…
Browse files Browse the repository at this point in the history
…ials

This uses the github cli as a credential helper for the push command.

Also included is a change to stop the job failing if the PR already exists.

Signed-off-by: Adam Talbot <adam.talbot@venafi.com>
  • Loading branch information
ThatsMrTalbot committed May 20, 2024
1 parent d9d816a commit f2792cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/olm-bundle/01_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ olm-publish-$(subst /,-,$1): olm-bundle | $(NEEDS_GH) $(bin_dir)/scratch
$(if $(and $(findstring redhat-openshift-ecosystem/certified-operators,$1),$(olm_project_id)), \
$(YQ) -i '.cert_project_id = "$(olm_project_id)"' operators/$(olm_project_name)/ci.yaml &&) \
git add operators/$(olm_project_name)/ci.yaml && \
git commit -m "operator $(olm_project_name) ($(patsubst v%,%,$(VERSION)))" && \
git push origin $(VERSION) && \
$(GH) pr create --repo $1 --head $(firstword $(subst /, ,$2)):$(VERSION) --title "operator $(olm_project_name) ($(patsubst v%,%,$(VERSION)))"
git commit -m "operator $(olm_project_name) ($(VERSION))" && \
git push -f -c "credential.helper=!$(GH) auth git-credential" origin $(VERSION) && \
{ $(GH) pr create --repo $1 --head $(firstword $(subst /, ,$2)):$(VERSION) --title "operator $(olm_project_name) ($(VERSION))" ||: }

olm-publish: olm-publish-$(subst /,-,$1)
endef
Expand Down

0 comments on commit f2792cd

Please sign in to comment.