Skip to content

Environment names with spaces no longer work #298

@hashtagchris

Description

@hashtagchris

Describe the Issue

npm upgraded directly from v4.4.0 to 9.4.0. It mostly went smoothly, but our database migration workflows stopped working. Our environment names include up and down to support reverting migrations.

Action Configuration

    steps:
      - name: branch-deploy
        id: branch-deploy
        uses: github/branch-deploy@91f77d0f24b03ff5f3d0fd24ce45498d1690d16b # pin 9.4.0
        with:
          environment: up sandbox
          environment_targets: up sandbox,down sandbox,up staging,down staging,up production,down production
          stable_branch: ${{ inputs.main_branch }}
          trigger: ".migrate"
          # We don't want the migration locks to interfere with the main chatops workflow
          lock_trigger: .an-lock-random-obscure-string-that-shouldnt-be-typed-ever
          unlock_trigger: .an-unlock-random-obscure-string-that-shouldnt-be-typed-ever
          skip_reviews: 'up sandbox,down sandbox'
          update_branch: warn

Relevant Actions Log Output

2024-08-22T19:44:55.6510210Z ##[group]Run github/branch-deploy@91f77d0f24b03ff5f3d0fd24ce45498d1690d16b
2024-08-22T19:44:55.6511127Z with:
2024-08-22T19:44:55.6511561Z   environment: up sandbox
2024-08-22T19:44:55.6512588Z   environment_targets: up sandbox,down sandbox,up staging,down staging,up production,down production
2024-08-22T19:44:55.6513632Z   stable_branch: master
2024-08-22T19:44:55.6514139Z   trigger: .migrate
2024-08-22T19:44:55.6514882Z   lock_trigger: .an-lock-random-obscure-string-that-shouldnt-be-typed-ever
2024-08-22T19:44:55.6516123Z   unlock_trigger: .an-unlock-random-obscure-string-that-shouldnt-be-typed-ever
2024-08-22T19:44:55.6517272Z   skip_reviews: up sandbox,down sandbox
2024-08-22T19:44:55.6518004Z   update_branch: warn
2024-08-22T19:44:55.6518711Z   github_token: ***
2024-08-22T19:44:55.6519184Z   status: success
2024-08-22T19:44:55.6519595Z   environment_url_in_comment: true
2024-08-22T19:44:55.6520209Z   production_environments: production
2024-08-22T19:44:55.6520898Z   reaction: eyes
2024-08-22T19:44:55.6521327Z   noop_trigger: .noop
2024-08-22T19:44:55.6521769Z   help_trigger: .help
2024-08-22T19:44:55.6522247Z   lock_info_alias: .wcid
2024-08-22T19:44:55.6522747Z   permissions: write,maintain,admin
2024-08-22T19:44:55.6523329Z   param_separator: |
2024-08-22T19:44:55.6523914Z   global_lock_flag: --global
2024-08-22T19:44:55.6524415Z   outdated_mode: strict
2024-08-22T19:44:55.6525146Z   required_contexts: false
2024-08-22T19:44:55.6525632Z   checks: all
2024-08-22T19:44:55.6526016Z   allow_forks: true
2024-08-22T19:44:55.6526449Z   admins: false
2024-08-22T19:44:55.6526822Z   admins_pat: false
2024-08-22T19:44:55.6527240Z   merge_deploy_mode: false
2024-08-22T19:44:55.6527750Z   unlock_on_merge_mode: false
2024-08-22T19:44:55.6528241Z   skip_completing: false
2024-08-22T19:44:55.6528824Z   deploy_message_path: .github/deployment_message.md
2024-08-22T19:44:55.6529453Z   sticky_locks: false
2024-08-22T19:44:55.6529890Z   sticky_locks_for_noop: false
2024-08-22T19:44:55.6530427Z   allow_sha_deployments: false
2024-08-22T19:44:55.6530965Z   disable_naked_commands: false
2024-08-22T19:44:55.6531545Z   skip_successful_noop_labels_if_approved: false
2024-08-22T19:44:55.6532244Z   skip_successful_deploy_labels_if_approved: false
2024-08-22T19:44:55.6532892Z ##[endgroup]
2024-08-22T19:44:55.9986797Z ✅ comment body starts with trigger: �[35m.migrate
2024-08-22T19:44:56.3924857Z 🌍 environment: �[35mup sandbox
2024-08-22T19:44:57.9089891Z ✅ CI checks passed and required reviewers have been disabled for this environment
2024-08-22T19:44:57.9102769Z 🍯 sticky_locks: �[35mfalse�[0m
2024-08-22T19:44:57.9107906Z 🍯 sticky_locks_for_noop: �[35mfalse�[0m
2024-08-22T19:44:58.6947265Z ##[error]HttpError: refs/heads/up sandbox-branch-deploy-lock is not a valid ref name. - https://docs.github.com/rest/git/refs#create-a-reference
    at /home/runner/work/_actions/github/branch-deploy/91f77d0f24b03ff5f3d0fd24ce45498d1690d16b/node_modules/@octokit/request/dist-node/index.js:125:1
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at createBranch (/home/runner/work/_actions/github/branch-deploy/91f77d0f24b03ff5f3d0fd24ce45498d1690d16b/src/functions/lock.js:290:1)
    at lock (/home/runner/work/_actions/github/branch-deploy/91f77d0f24b03ff5f3d0fd24ce45498d1690d16b/src/functions/lock.js:642:1)
    at run (/home/runner/work/_actions/github/branch-deploy/91f77d0f24b03ff5f3d0fd24ce45498d1690d16b/src/main.js:517:1)
2024-08-22T19:44:58.6966927Z ##[error]refs/heads/up sandbox-branch-deploy-lock is not a valid ref name. - https://docs.github.com/rest/git/refs#create-a-reference
2024-08-22T19:44:58.7364488Z Post job cleanup.
2024-08-22T19:44:58.8300657Z ##[warning]⛔ �[35mbypass�[0m set, exiting
2024-08-22T19:44:58.8507136Z Cleaning up orphan processes

Extra Information

No response

Metadata

Metadata

Assignees

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