Comments (9)
@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.
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.
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.
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.
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.
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.
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.
@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.
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)
- update content of README.md
- setup: help with protected branch HOT 1
- Not a bug, just need help getting started... HOT 6
- Updating PR message
- Updating guide on `release:prepare` and `release:trigger` HOT 5
- What if we get rid of the concept of "mergeStrategy" ? HOT 2
- Generate .env when run shipjs setup HOT 5
- failure in setting npm config in shipjs trigger HOT 7
- Can't trigger release if there's only one commit HOT 3
- pullRequestReviewers octokit deprecation error HOT 2
- Getting the branch in prepare for multiple releases HOT 1
- Dependency Dashboard
- [Vulnerability] An issue with shelljs in `shipjs-lib` internal package HOT 3
- Setup wizard showing incomplete branch names HOT 5
- "Git tag doesn't exist" in GitHub Actions HOT 2
- fix(deps): issue with one of the transitive dependency causing dependabot alert(s) HOT 1
- Not able to authenticate using Github Enterprise version HOT 10
- make `nextVersion` work with multiple versions
- trigger workflow fails to create a tag HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shipjs.