Skip to content

revision is wrong (push to open PR) #283

Closed
@dimaqq

Description

@dimaqq

First of all, pardon me if this is a known GitHub Actions issue...

My action code:

            echo "try 2 version:"                                                         
            cat << EOF                                                                    
            ${{ steps.tag.outputs.version }}                                              
            EOF                                                                           
            echo "try 2 tags:"                                                            
            cat << EOF                                                                    
            ${{ steps.tag.outputs.tags }}                                                 
            EOF                                                                           
            echo "try 2 labels:"                                                          
            cat << EOF                                                                    
            ${{ steps.tag.outputs.labels }}                                               
            EOF                                                                           
            echo "try 2 json:"                                                            
            jq . << EOF                                                                   
            ${{ steps.tag.outputs.json }}                                                 
            EOF                                                                           
            echo                                                                          
            echo "github event"                                                           
            jq . $GITHUB_EVENT_PATH     

where tag is docker/medata-action@v4

When I push another commit to a branch with an open PR, I get this output:

try 2 version:
pr-10  # OK!
try 2 tags:
my/image:pr-10  # OK!
try 2 labels:
...
org.opencontainers.image.version=pr-10  # OK!
org.opencontainers.image.created=2023-04-06T02:30:38.641Z
org.opencontainers.image.revision=801fef0830758d8ccefdc8966569227b8bc22853  # ???
org.opencontainers.image.licenses=
try 2 json:
{
  "tags": [
    "my/image:pr-10"
  ],
  "labels": {
...
    "org.opencontainers.image.version": "pr-10",
    "org.opencontainers.image.created": "2023-04-06T02:30:38.641Z",
    "org.opencontainers.image.revision": "801fef0830758d8ccefdc8966569227b8bc22853",  # ???
    "org.opencontainers.image.licenses": ""
  }
}

github event
{
  "action": "synchronize",
  "after": "d7a982e8f5b039c7e4607f87a826f74c53918aec",  # correct!
  "before": "5dc80b95cd193b52101c1eecb83961bf16139966",
  "number": 10,
  "organization": {
...

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions