Skip to content

Error on non existing branches #424

@r-ising

Description

@r-ising

Describe the Issue

Hello,

thanks for this library, it is very helpful in our daily business.

Users are sometimes writing the "deploy" command after a PR is merged. Because we delete branches after merging, the following happens:

  1. The lock is created.
  2. The action crashes (cannot find the branch).
  3. The lock remains stuck indefinitely.

Suggestion:
Is it possible to implement a check to verify the branch exists before locking, or ensure the lock is removed correctly if the action fails?

Thanks

Action Configuration

Relevant Actions Log Output

🍯 sticky_locks: false
🍯 sticky_locks_for_noop: false
🔒 created lock branch: dev2-branch-deploy-lock
✅ deployment lock obtained
Error: HttpError: No ref found for: XXXXXXXXX - https://docs.github.com/rest/deployments/deployments#create-a-deployment
    at file:///__w/_actions/github/branch-deploy/v11.1.0/node_modules/@actions/github/node_modules/@octokit/request/dist-node/index.js:125:1
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at run (file:///__w/_actions/github/branch-deploy/v11.1.0/src/main.js:793:1)
Error: No ref found for: XXXXXXXXX - https://docs.github.com/rest/deployments/deployments#create-a-deployment

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