Update api names list #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update api names list | |
on: | |
workflow_dispatch: | |
jobs: | |
Update: | |
permissions: | |
contents: 'write' | |
id-token: 'write' | |
pull-requests: 'write' | |
defaults: | |
run: | |
shell: bash | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
# workload_identity_provider: "projects/102075874751/locations/global/workloadIdentityPools/gh-places-deploy-dev/providers/gh-places-dev-provider" | |
# service_account: "[email protected]" | |
workload_identity_provider: "projects/963616447866/locations/global/workloadIdentityPools/gh-deploy-dev-portal-rd/providers/gh-dev-portal-provider-rd" | |
service_account: "gha-enable-apis@premise-developer-portal-rd.iam.gserviceaccount.com" | |
# workload_identity_provider: "projects/98058317567/locations/global/workloadIdentityPools/gh-deploy-data-platform-dev/providers/gh-data-platform-dev-provider" | |
# service_account: "deploy-cloudrun-cicd@premise-data-platform-dev.iam.gserviceaccount.com" | |
- name: Set up Cloud SDK | |
uses: 'google-github-actions/setup-gcloud@v1' | |
- name: Install gcloud beta | |
run: gcloud components install beta | |
- name: Config gcloud | |
run: gcloud config set account [email protected]:com | |
- name: Generate temporal api list file | |
run: > | |
gcloud beta services list --available --format='value(NAME)' --filter="NAME:googleapis" > ./packages/backend/public/apis.tmp | |
- name: Create branch update-api-name-list | |
run: > | |
git checkout -B update-api-name-list | |
- name: Config git email | |
run: > | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Config git user name | |
run: > | |
git config --local user.name "github-actions[bot]" | |
- name: Remove old file | |
run: > | |
git rm ./packages/backend/public/apis.txt | |
- name: Create updated api.txt file | |
run: > | |
cat ./packages/backend/public/apis.tmp > ./packages/backend/public/apis.txt | |
- name: Add updated api.txt file and commit | |
run: > | |
git add ./packages/backend/public/apis.txt | |
- name: Commit allowing empty changes | |
run: > | |
git commit --allow-empty -m "[UPDATE] api names list for developer portal" | |
- name: Set upstream git branch name to update-api-name-list | |
run: > | |
git push --set-upstream origin update-api-name-list | |
- name: Push to update-api-name-list | |
run: > | |
git push | |
- name: create pull request | |
run: > | |
gh pr create -B main -H update-api-name-list --title '[Created by Github action]' --body 'Update api names list for developer portal Enable GCP Service API template' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |