We’re experiencing an intermittant issue with how the
GITHUB_REF environment variable is being set on workflows triggered from a commit within a Pull Request.
Usually, this is set to
refs/pull/:prNumber/merge – which we then parse to extract the PR number, to use in constructing the name of a temporary “review app” deployment.
However, sometimes the GITHUB_REF is set to
refs/heads/:branchName instead, which breaks our deployment.
This has only started happening fairly recently.
Is this a bug? Or is there a more reliable way of getting the PR number from workflows triggered by pushed commits within pull requests?