Skip to content

fix(git): handle properly detached HEAD ref - #173

Merged
crazy-max merged 1 commit into
docker:mainfrom
hoverkraft-tech:fix/handle-detached-ref
Sep 23, 2023
Merged

crazy-max merged 1 commit into
docker:mainfrom
hoverkraft-tech:fix/handle-detached-ref

Conversation

@neilime

@neilime neilime commented Sep 19, 2023

Copy link
Copy Markdown
Contributor

Properly manage detached HEAD when getting ref.

  • Check if we are in a detached HEAD context
  • If so handle detached tag and branch context

@crazy-max crazy-max left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

Just to clarify, did you encounter an issue with the current API? I guess with metadata-action?

@neilime

neilime commented Sep 22, 2023 •

Copy link
Copy Markdown
Contributor Author

@crazy-max by example:

If I'm checking out a pull request branch (Needed on issue_comment event by example):

  - uses: actions/checkout@v3
    with:
      ref: refs/pull/${{ github.event.issue.number }}/head

  - uses: docker/metadata-action@v5.0.0

I got the following error

Error: fatal: No names found, cannot describe anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants