Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 23, 2023
Merged

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

merged 1 commit into from
Sep 23, 2023

Conversation

neilime
Copy link
Contributor

@neilime neilime commented Sep 19, 2023

Properly manage detached HEAD when getting ref.

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

Copy link
Member

@crazy-max crazy-max left a comment

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
Copy link
Contributor Author

neilime commented Sep 22, 2023

@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.

@crazy-max crazy-max merged commit e75930a into docker:main Sep 23, 2023
17 checks passed
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.

None yet

2 participants