So if one passes a GCP project ID (number) instead of the project name, you get an error like this:
failed to execute gcloud command `gcloud app deploy --quiet --format json app.yaml --project ***..`
The value of ``--project'' flag was set to Project number. To use this command, set it to PROJECT ID instead.
Expected behavior
The action arg probably would be clearer if named project and/or pass the action's project_id value as the --project-iddeploy arg.
Observed behavior
Using a GCP project ID (ex: 1011234567890)
Results in an error:
Error: google-github-actions/deploy-appengine failed with: failed to execute gcloud command `gcloud app deploy --quiet --format json app.yaml --project *** --version 20240308-commit-8860de5 --promote`: ERROR: (gcloud.app.deploy) The value of ``--project'' flag was set to Project number.To use this command, set it to PROJECT ID instead.
Action YAML
name: Deploy
on:
push:
branches: [main]
workflow_run:
workflows: ["Test"]
types: [completed]
branches: [main]
workflow_dispatch:
# Cancel any existing deployments so only latest one is deployed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-deploy-to-app-engine:
# TODO: Fix condition to run on successful tests run
# if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: "read"
id-token: "write"
environment: production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: "auth"
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: "${{ secrets.WIF_PROVIDER }}"
service_account: "${{ secrets.GCP_SA_EMAIL }}"
- name: 🏗 App Version
# Ex version: "20231213-commit-643ef27"
run: |
echo "GIT_HEAD=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "APP_VERSION=$( date '+%Y%m%d' )-commit-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- id: "deploy"
uses: "google-github-actions/deploy-appengine@v2"
with:
project_id: "${{ secrets.GCP_PROJECT_ID}}" # Ex: 1011234567890
version: "${{ env.APP_VERSION }}"
deliverables: "app.yaml"
promote: true
build_env_vars: |-
GOFLAGS=-mod=mod
Log output
Run google-github-actions/deploy-appengine@v2
/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/[redacted] -f /home/runner/work/_temp/[redacted]
Successfully authenticated
Running: gcloud app deploy --quiet --format json app.yaml --project *** --version 20240308-commit-8860de5 --promote
Error: google-github-actions/deploy-appengine failed with: failed to execute gcloud command `gcloud app deploy --quiet --format json app.yaml --project *** --version 20240308-commit-8860de5 --promote`: ERROR: (gcloud.app.deploy) The value of ``--project'' flag was set to Project number.To use this command, set it to PROJECT ID instead.
TL;DR
The
project_id
Action argument is mapped toproject
when passed to thedeploy
command. https://github.com/google-github-actions/deploy-appengine/blob/24e0c36ed7593b83beee803db490735c270338d6/src/main.ts#L161-L162So if one passes a GCP project ID (number) instead of the project name, you get an error like this:
Expected behavior
The action arg probably would be clearer if named
project
and/or pass the action'sproject_id
value as the--project-id
deploy
arg.Observed behavior
Using a GCP project ID (ex:
1011234567890
) Results in an error:Action YAML
Log output
Additional information
No response