Code Monkey home page Code Monkey logo

Comments (9)

eunjae-lee avatar eunjae-lee commented on June 11, 2024 1

@tyankatsu0105 yes, the flow will run on every pr closed, which is not ideal, but the flow gets closed.

You can change the staging branch name with this config. It is not documented, but it works.

Maybe we should use startsWith(github.head_ref, 'releases/v') as you said. GitHub provides this better control which CircleCI doesn't have. So we should leverage that.

And if we later document getStagingBranchName then we will put WARNING so that they can update their github workflow as well.

Okay, let's 🛳 it

from shipjs.

tyankatsu0105 avatar tyankatsu0105 commented on June 11, 2024

I tried to upgrade Ship.js at this repo https://github.com/tyankatsu0105/eslint-plugin/tree/v0.13.2.
Finally, it works well.

from shipjs.

eunjae-lee avatar eunjae-lee commented on June 11, 2024

One of the reasons why mergeStrategy is removed is, user is asked about that when they try Ship.js for the first time (shipjs setup) and it might be difficult to understand if they have no experience.

Do you think this section is not visible enough? Or does it lack enough explanation or example?

I hope to solve this issue on the user-land (but with clear documentation). What do you think?


How did your previous GitHub workflow config not work?

   push:
     branches:
       - develop

it seems okay, but what kind of issue did you have with it?

from shipjs.

tyankatsu0105 avatar tyankatsu0105 commented on June 11, 2024

OK. I try to explain this issue.

I created verification repo https://github.com/tyankatsu0105/verification-shipjs-897

My branch strategy is theses:

  • develop => develop branch (default)
  • master => keep latest release

First, this is my setup choices:

? What is your base branch?
  This is also called "Default branch".
  You usually merge pull-requests into this branch. develop
? Which CI configure? GitHub Actions
? Add manual prepare with issue comment?
  You can create `@shipjs prepare` comment on any issue and then github actions run `shipjs prepare` No
? Schedule your release? No
? Publish public package? Yes

Then this workflow was created:

name: Ship js trigger
on:
  push:
    branches:
      - develop
jobs:
  build:
    name: Release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ref: develop
      - uses: actions/setup-node@v1
        with:
          registry-url: "https://registry.npmjs.org"
      - run: |
          if [ -f "yarn.lock" ]; then
            yarn install
          else
            npm install
          fi
      - run: npx shipjs trigger
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
          SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}

But this condition of on looks strange for me.
For example, when this PR is merged, this flow run.
But this flow should run when PR(made with npm run release (shipjs prepare)) is merged.
So I propose adding example changing flow.

on:
  pull_request:
   types:
      - closed

if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')

from shipjs.

tyankatsu0105 avatar tyankatsu0105 commented on June 11, 2024

The reason for adding fetch-depth: 0 is a success for Release Snapshot.
This flow is failed. Because fetch-depth: 0 is missing.

from shipjs.

eunjae-lee avatar eunjae-lee commented on June 11, 2024

Hey @tyankatsu0105, Thanks for the detail.
I think it's good to add fetch-depth: 0 to the default config in Ship.js, because it won't harm even if they don't do things like release snapshot.


About the on condition, that is a good point, but I think this can apply to all cases, not only to release snapshot, right?

from shipjs.

tyankatsu0105 avatar tyankatsu0105 commented on June 11, 2024

@eunjae-lee

I think it's good to add fetch-depth: 0 to the default config in Ship.j

OK. I will send PR for adding fetch-depth: 0.

but I think this can apply to all cases, not only to release snapshot, right?

Yes. In situations where shipjs triggers are used, my proposed on condition is probably better than the current condition.
Do we change to this?:

on:
  pull_request:
   types:
      - closed

from shipjs.

eunjae-lee avatar eunjae-lee commented on June 11, 2024

@tyankatsu0105
yes

on:
  pull_request:
   types:
      - closed

sounds good, but I think we should not have startsWith(github.head_ref, 'releases/v') because users can customize their staging branch name to something else.

from shipjs.

tyankatsu0105 avatar tyankatsu0105 commented on June 11, 2024

Umm...
@eunjae-lee
If not use startsWith(github.head_ref, 'releases/v'), this flow will run every PR is closed.
It's not good.

Btw, How can we change the release branch name?

from shipjs.

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.