Skip to content

Environment Variables not updating #429

@mstrofbass

Description

@mstrofbass

TL;DR

  1. Deployed a new cloud function via this action without environment variables.
  2. Updated the action to include environment variables
  3. Deployed the cloud function via this action
  4. None of the environment variables were set
  5. Deleted the cloud function
  6. Redeployed via this action with no changes
  7. Environment variables were set
  8. Updated one environment variable
  9. Redeployed via this action
  10. Environment variable was not updated

The documentation says "If a non-empty value is given, the field values will be overwritten (not merged)" but this does not appear to be happening. I am 90% sure this was functioning in a different project I was working on a week or two ago but I am not sure.

Expected behavior

When changing the contents of environment_variables in this action, I expect the environment variables used by the cloud function to be updated to match the contents of the environment_variables.

Observed behavior

The cloud function environment variables were not set.

Action YAML

name: "Deploy Cloud Fn"

on:
  workflow_dispatch:
    inputs:
      yml-config-path:
        required: true
        type: string
  workflow_call:
    inputs:
      yml-config-path:
        required: true
        type: string

jobs:
  deploy:
    runs-on: ubuntu-latest

    permissions:
      contents: "read"
      id-token: "write"

    steps:
      - name: Check out code
        uses: actions/checkout@v3

      - name: Load environment from YAML
        uses: doughepi/yaml-env-action@v1.0.0
        with:
          files: ${{ inputs.yml-config-path }}

      - id: auth
        uses: google-github-actions/auth@v2
        with:
          project_id: ${{ env.GCP_PROJECT_ID }}
          workload_identity_provider: ${{ env.GCP_WORKLOAD_IDENTITY_PROVIDER }}

      - id: "deploy"
        uses: "google-github-actions/deploy-cloud-functions@v3"
        timeout-minutes: 10
        with:
          runtime: "nodejs22"
          project_id: ${{ env.GCP_PROJECT_ID }}
          region: ${{ env.GCP_REGION }}
          service_account: ${{ env.GCP_SERVICE_ACCOUNT }}
          name: ${{ env.GCP_FN_NAME }}
          environment_variables: ${{ env.GCP_ENV_VARS }}
          secrets: ${{ env.GCP_SECRETS }}
          max_instance_count: ${{ env.GCP_MAX_INSTANCE_COUNT }}
          service_timeout: ${{ env.GCP_SERVICE_TIMEOUT }}
          memory: ${{ env.GCP_GCS_FN_MEMORY }}

Log output

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy