-
Notifications
You must be signed in to change notification settings - Fork 119
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
revision is wrong (push to open PR) #283
Comments
@dimaqq Can you post your workflow please? Even better if you have a link to your repo. |
There you go: https://github.com/dimaqq/mre-metadata-action-283 repo Here are all the git commits in the repo, all branches: > gt
* 3fe33e0 (HEAD -> branch-1, origin/branch-1) a sample change
* 93d6762 (origin/main, origin/HEAD, main) CI debug for https://github.com/docker/metadata-action/issues/283
* c650ac7 Initial commit Here's the GHA run: https://github.com/dimaqq/mre-metadata-action-283/actions/runs/4718439641/jobs/8368042252 Extract: 2023-04-17T07:09:03.1641463Z ##[group]JSON output
2023-04-17T07:09:03.1641740Z {
2023-04-17T07:09:03.1642057Z "tags": [
2023-04-17T07:09:03.1642593Z "quay.io/somerepo/someimage:pr-1"
2023-04-17T07:09:03.1642904Z ],
2023-04-17T07:09:03.1643199Z "labels": {
2023-04-17T07:09:03.1643746Z "org.opencontainers.image.title": "mre-metadata-action-283",
2023-04-17T07:09:03.1644437Z "org.opencontainers.image.description": "https://github.com/docker/metadata-action/issues/283",
2023-04-17T07:09:03.1645873Z "org.opencontainers.image.url": "https://github.com/dimaqq/mre-metadata-action-283",
2023-04-17T07:09:03.1646669Z "org.opencontainers.image.source": "https://github.com/dimaqq/mre-metadata-action-283",
2023-04-17T07:09:03.1647318Z "org.opencontainers.image.version": "pr-1",
2023-04-17T07:09:03.1647868Z "org.opencontainers.image.created": "2023-04-17T07:09:03.153Z",
2023-04-17T07:09:03.1648589Z "org.opencontainers.image.revision": "5d733763d2c575d9ac25b5c0922cbc1ac828df8f",
2023-04-17T07:09:03.1649174Z "org.opencontainers.image.licenses": "MIT"
2023-04-17T07:09:03.1649496Z }
2023-04-17T07:09:03.1649777Z } The (my guess is that this is GitHub's magical "this would be the merge commit if the PR was merged" hash) |
Yes this looks similar to #206. You need to set the associated head sha on pull request event by setting the - id: tag
uses: docker/metadata-action@v4
with:
images:
quay.io/somerepo/someimage
env:
DOCKER_METADATA_PR_HEAD_SHA: true |
Yep, looks the same. |
Just stumbled upon this PR and thought the same to myself until I saw #239 |
omg, this should be default |
It's not otherwise we break other workflows. Please see #239 |
First of all, pardon me if this is a known GitHub Actions issue...
My action code:
where
tag
is docker/medata-action@v4When I push another commit to a branch with an open PR, I get this output:
Where did the
801fef0...
hash come from?It's not in the github event at all.
Meanwhile, my local checkout has my git commit
d7a982...
on top, in line with github event.And there's no commit like
801...
in my history.At the same time, if I push a tag, the
revision
is correct, it's the git hash that the tag points to.The text was updated successfully, but these errors were encountered: