Giter Club home page Giter Club logo

Comments (5)

bobheadxi avatar bobheadxi commented on May 30, 2024 2

Closed by #9, support for pull_request via ref: ${{ github.head_ref }} is now available in https://github.com/bobheadxi/deployments/releases/tag/v0.4.0! Thanks @codyleblanc

from deployments.

bobheadxi avatar bobheadxi commented on May 30, 2024

Can you post your workflow configuration? Also maybe take a look at the discussion in #4 regarding configuration

from deployments.

rlataguerra avatar rlataguerra commented on May 30, 2024

As it is explained in #4 I guess my problem comes from using the pull_request event :/
No workaround beside using push ?

from deployments.

bobheadxi avatar bobheadxi commented on May 30, 2024

Not at the moment, mostly for my reason outlined here:

looks like the event pull_request only procs on 3 conditions:

Note: By default, a workflow only runs when a pull_request's activity type is opened, synchronize, or reopened. To trigger workflows for more activity types, use the types keyword.

This is pretty unlikely to be what you actually want, since you won't be able to update your deployment on subsequent pushes to your pull request. I would advise just switching to push, and add the branches you want to deploy for your pull request by hand as we do

I'm open to input however! (ie is there a use case you have that requires pull_request and PR deployment status integration?)

from deployments.

xt0rted avatar xt0rted commented on May 30, 2024

I published an action earlier for a different type of workflow but it might be usable with the pull_request event too. https://github.com/xt0rted/pull-request-comment-branch

What this does is checks the current event's issue to see if it's a PR or not, if so it gets the head ref and sha for the PR branch.

When run on a pull_request event this should run through and get the branch info. As long as it does you can then use that on the actions/checkout step to get the right branch.

I'm not sure if the context from @actions/github will have the correct ref loaded, but it's worth a quick test to see. This action won't work with the push event so you'd have to remove that for now or use an if check to only run this on pull_request events.

from deployments.

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.