Skip to content

The github.ref does not contain fully-formed ref of the branch #22727

@trivikr

Description

@trivikr

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries

What part(s) of the article would you like to see updated?

The workflow run on my GitHub repo indicates that github.ref contains destination branch when PR is closed, and not refs/pull/<pr_number>/merge

Note that:

  • Workflow file says BRANCH=${{ github.ref }}
  • Workflow run prints BRANCH=main

Either the documentation needs to be updated to use the following solution instead:

BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"

Or the backend code needs to be fixed to provide branch name in github.ref

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionsThis issue or pull request should be reviewed by the docs actions teamcontentThis issue or pull request belongs to the Docs Content teamhelp wantedAnyone is welcome to open a pull request to fix this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions