GithubHelp home page GithubHelp logo

Comments (8)

mithro avatar mithro commented on August 10, 2024

The issue seems to be that;

  • for pull_request you get a GITHUB_REF=refs/pull/4/merge
  • for pull_request_target you get a GITHUB_REF=refs/heads/upstream-main

from metadata-action.

crazy-max avatar crazy-max commented on August 10, 2024

@mithro Filtering on pull_request_target event name and using the event.number lgtm in this case.

from metadata-action.

mithro avatar mithro commented on August 10, 2024

I have a hack at mithro@15f1e09

from metadata-action.

mithro avatar mithro commented on August 10, 2024

Looks like the hack works;

Context info
  eventName: pull_request_target
  sha: d72e4c711d46aca30ac89aed82631c1ae15dd307
  ref: refs/pull/6/merge
  workflow: Build Docker Image for Run DRC for cell GDS (using Magic) Action
  action: mithrometadata-action
  actor: mithro
  runNumber: 52
  runId: 867669317

from metadata-action.

crazy-max avatar crazy-max commented on August 10, 2024

@mithro You can try with docker/metadata-action@master.

from metadata-action.

mithro avatar mithro commented on August 10, 2024

@crazy-max -- I'm still getting a tag for the base branch (IE localhost:5000/run-drc-for-cell-gds-using-magic:main) - Have I configured things wrong or is pull_request_target getting misunderstood as being a branch/tag event as well as a pull request event? Output below;

  with:
    images: localhost:5000/run-drc-for-cell-gds-using-magic,gcr.io/skywater-pdk/actions/run-drc-for-cell-gds-using-magic
    tags: type=ref,event=tag
  type=ref,event=pr
  type=ref,event=branch
  type=sha
  type=sha,format=long
  
    github-token: ***
  env:
    ACTION_NAME: run-drc-for-cell-gds-using-magic
Context info
  eventName: pull_request_target
  sha: 1791415f66d16e92bdc523c59e68383db3b32d74
  ref: refs/heads/main
  workflow: Build Docker Image for Run DRC for cell GDS (using Magic) Action
  action: dockermetadata-action
  actor: mithro
  runNumber: 22
  runId: 875362048
Processing tags input
Processing flavor input
Docker image version
  pr-21
Docker tags
  localhost:5000/run-drc-for-cell-gds-using-magic:pr-21
  localhost:5000/run-drc-for-cell-gds-using-magic:main
  localhost:5000/run-drc-for-cell-gds-using-magic:sha-1791415
  localhost:5000/run-drc-for-cell-gds-using-magic:sha-1791415f66d16e92bdc523c59e68383db3b32d74
  gcr.io/skywater-pdk/actions/run-drc-for-cell-gds-using-magic:pr-21
  gcr.io/skywater-pdk/actions/run-drc-for-cell-gds-using-magic:main
  gcr.io/skywater-pdk/actions/run-drc-for-cell-gds-using-magic:sha-1791415
  gcr.io/skywater-pdk/actions/run-drc-for-cell-gds-using-magic:sha-1791415f66d16e92bdc523c59e68383db3b32d74

from metadata-action.

crazy-max avatar crazy-max commented on August 10, 2024

@mithro

Have I configured things wrong or is pull_request_target getting misunderstood as being a branch/tag event as well as a pull request event?

Yes it's a bug indeed. It seems that the context must be modified to avoid any overflow with the branch events. In the meantime you can do this:

tags: |
  type=ref,event=tag
  type=ref,event=pr
  type=ref,event=branch,enable=${{ github.event_name != 'pull_request_target' }}
  type=sha
  type=sha,format=long

Can you open a new issue about that please?

from metadata-action.

mithro avatar mithro commented on August 10, 2024

@crazy-max - #96 created.

from metadata-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.