From 2ee073f8f81fecf7c1015112e44d655ca537de5e Mon Sep 17 00:00:00 2001 From: SheryarButt Date: Thu, 9 May 2024 14:38:45 +0500 Subject: [PATCH 1/2] Update --- .../publish_operator_image_and_bundle.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish_operator_image_and_bundle.yaml b/.github/workflows/publish_operator_image_and_bundle.yaml index 71c9aa0..0a1a4ce 100644 --- a/.github/workflows/publish_operator_image_and_bundle.yaml +++ b/.github/workflows/publish_operator_image_and_bundle.yaml @@ -170,7 +170,7 @@ jobs: - name: Generate image repository path run: | echo IMAGE_REPOSITORY=$(echo quay.io/${{ secrets.OPERATORHUB_REPOSITORY }}) >> $GITHUB_ENV - + # Build and push tag - name: Build and push id: build_and_push @@ -273,12 +273,6 @@ jobs: git status git add . git commit -m "[skip-ci] Update artifacts" -a - - - name: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.ADMIN_TOKEN }} - branch: main - name: Clone stakater/certified-operators repository uses: GuillaumeFalourd/clone-github-repo-action@v3 @@ -303,7 +297,14 @@ jobs: git add . git commit -am "Updated multi-tenant-operator to ${{ needs.publish-image.outputs.latest_tag}}" git push --set-upstream origin mto-${{ needs.publish-image.outputs.latest_tag}} - + cd .. + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.ADMIN_TOKEN }} + branch: main + - name: Set up QEMU uses: docker/setup-qemu-action@v3 From a2693afe2eb5e4596c96862ec7623806622fb77e Mon Sep 17 00:00:00 2001 From: SheryarButt Date: Thu, 9 May 2024 15:28:35 +0500 Subject: [PATCH 2/2] removes clone repo action --- .../publish_operator_image_and_bundle.yaml | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish_operator_image_and_bundle.yaml b/.github/workflows/publish_operator_image_and_bundle.yaml index 0a1a4ce..cb64115 100644 --- a/.github/workflows/publish_operator_image_and_bundle.yaml +++ b/.github/workflows/publish_operator_image_and_bundle.yaml @@ -275,11 +275,20 @@ jobs: git commit -m "[skip-ci] Update artifacts" -a - name: Clone stakater/certified-operators repository - uses: GuillaumeFalourd/clone-github-repo-action@v3 - with: - owner: 'stakater' - repository: 'certified-operators' - access-token: ${{ secrets.STAKATER_GITHUB_TOKEN }} + run: | + if [ -z "${{ secrets.STAKATER_GITHUB_TOKEN }}" ]; then + git clone https://github.com/stakater/certified-operators.git + else + git clone https://${{ secrets.STAKATER_GITHUB_TOKEN }}@github.com/stakater/certified-operators.git + fi + + if [ -d "certified-operators" ]; then + echo "Cloned certified-operators repository successfully." + echo "Access the repository content using \"cd certified-operators\"." + else + echo "Error: Couldn't clone certified-operators repository. Check the inputs or the PAT scope." + exit 1 + fi - name: Push branch run: | @@ -297,7 +306,6 @@ jobs: git add . git commit -am "Updated multi-tenant-operator to ${{ needs.publish-image.outputs.latest_tag}}" git push --set-upstream origin mto-${{ needs.publish-image.outputs.latest_tag}} - cd .. - name: Push changes uses: ad-m/github-push-action@master