diff --git a/.github/workflows/upload-assets.yml b/.github/workflows/upload-assets.yml index 88806bd..30c6bae 100644 --- a/.github/workflows/upload-assets.yml +++ b/.github/workflows/upload-assets.yml @@ -6,7 +6,7 @@ on: - 'v?[0-9]+.[0-9]+.[0-9]+(?:-.*)?' permissions: id-token: write - contents: read + contents: write jobs: upload-assets: @@ -24,17 +24,11 @@ jobs: name: Authenticate with GCP uses: 'google-github-actions/auth@v2' with: + token_format: 'access_token' project_id: 'sap-kyma-jellyfish-dev' workload_identity_provider: 'projects/718973091829/locations/global/workloadIdentityPools/github-action/providers/github-actions' service_account: 'github-actions-sa@sap-kyma-jellyfish-dev.iam.gserviceaccount.com' - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v2' - with: - version: '>= 363.0.0' - - name: Login to gcloud - run: |- - gcloud info - #- name: Run upload assets script - # run: bash ./scripts/release/upload_assets.sh + - name: Run upload assets script + run: bash ./scripts/release/upload_assets.sh diff --git a/Makefile b/Makefile index 205e047..36254bb 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ endif # This will change the flags of the `kyma alpha module create` command in case we spot credentials # Otherwise we will assume http-based local registries without authentication (e.g. for k3d) -ifneq (,$(PROW_JOB_ID)) +ifneq (,$(PULL_BASE_REF)) GCP_ACCESS_TOKEN=$(shell gcloud auth application-default print-access-token) MODULE_CREATION_FLAGS=--registry $(MODULE_REGISTRY) --module-archive-version-overwrite -c oauth2accesstoken:$(GCP_ACCESS_TOKEN) else ifeq (,$(MODULE_CREDENTIALS)) diff --git a/scripts/release/upload_assets.sh b/scripts/release/upload_assets.sh index 1160068..cf44e11 100755 --- a/scripts/release/upload_assets.sh +++ b/scripts/release/upload_assets.sh @@ -39,7 +39,7 @@ echo "Fetching releases" CURL_RESPONSE=$(curl -w "%{http_code}" -sL \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer $GITHUB_TOKEN"\ - https://api.github.com/repos/kyma-project/template-operator/releases) + https://api.github.com/repos/nesmabadr/template-operator/releases) JSON_RESPONSE=$(sed '$ d' <<< "${CURL_RESPONSE}") HTTP_CODE=$(tail -n1 <<< "${CURL_RESPONSE}") if [[ "${HTTP_CODE}" != "200" ]]; then @@ -58,7 +58,7 @@ then fi echo "Adding assets to Github release" -UPLOAD_URL="https://uploads.github.com/repos/kyma-project/template-operator/releases/${RELEASE_ID}/assets" +UPLOAD_URL="https://uploads.github.com/repos/nesmabadr/template-operator/releases/${RELEASE_ID}/assets" echo "$UPLOAD_URL" uploadFile "template-operator.yaml" "${UPLOAD_URL}?name=template-operator.yaml"