Giter Club home page Giter Club logo

Comments (4)

JamesIves avatar JamesIves commented on May 9, 2024

I think modifying the example might be better than removing the configuration option. My reasoning for that is because it's not always a push event that triggers these workflows, so there may not be a ref available in the workflow env. Scheduled jobs for example is one case where GITHUB_REF will be undefined.

The other option would be to remove the base branch configuration option and instead setup an example that uses actions/checkout that checks out a specific branch before the action runs: https://github.com/actions/checkout#usage.

Do you have any preference? Also happy to review any PR's if you'd like to make the change.

from github-pages-deploy-action.

nickmccurdy avatar nickmccurdy commented on May 9, 2024

I see the scheduling issue, thanks for explaining.

Now that you mention it, it sounds more consistent and reusable to let the checkout action have full control over what ref/branch is built (rather than having env.BASE_BRANCH). However, this could cause development on other branches to cause extra builds on master. Are you suggesting to keep on.push.branches in the readme to alleviate this, or is there a better alternative?

Alternatively we could use GITHUB_SHA, which is automatically set to the latest commit on the default branch in a scheduled build.

from github-pages-deploy-action.

JamesIves avatar JamesIves commented on May 9, 2024

I've been thinking about this more and I think removing env.BASE_BRANCH would end up causing some issues. The reason for this is that the action switches between the deployment branch and the base branch initially to ensure the branch it's deploying to actually exists: https://github.com/JamesIves/github-pages-deploy-action/blob/master/entrypoint.sh#L55-L68

I think modifying the README example to not specify a branch in on.push would be better. The on.push branch filtering is up to the person creating the workflow, and it isn't really related to how the action works so I can see how it just adds confusion.

We could also setup some redundancy, where if env.BASE_BRANCH exists then it uses that, otherwise it falls back to GITHUB_REF and then master. This way there's one less config option and the action will work for all types of use cases.

from github-pages-deploy-action.

JamesIves avatar JamesIves commented on May 9, 2024

I've pushed a change to the README in pull request #26 if you'd like to take a look!

https://github.com/JamesIves/github-pages-deploy-action/blob/example/README.md

from github-pages-deploy-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.