google-github-actions / deploy-cloud-functions

A GitHub Action that deploys source code to Google Cloud Functions.
https://cloud.google.com/functions
Apache License 2.0
311 stars 66 forks source link

Allow bash-resolved value for labels #394

Closed tlienart closed 11 months ago

tlienart commented 11 months ago

TL;DR

labels: |-
    commit=$(git rev-parse --short ${{github.event.pull_request.head.sha}})

won't work (this is a specific example but, unless I'm mistaken, other similar $(...) will fail).

Log output

"error": {
    "code": 400,
    "message": "The request has errors",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "labels",
            "description": "labels {(...) commit=\"$(git rev-parse --short XXX)\"} format is invalid"

^ looking at the log above seems to suggest that the value is just escaped and passed "as is". It'd be great to have the string potentially resolved first then passed to gcloud deploy.

sethvargo commented 11 months ago

There's no bash or shell running, so this is not possible.