question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve GitHub Actions template

See original GitHub issue

Is your feature request related to a problem? Please describe. The CI template that Ship.js provides is not correct for people wants to use Release Snapshot.

Describe the solution you’d like Add example CI configs at “Release Snapshot” section.

Describe alternatives you’ve considered Add example config. For example GitHub Actions:

name: Ship js trigger
on:
+  pull_request:
+   types:
+      - closed

-   push:
-     branches:
-       - develop

jobs:
  build:
    name: Release
    runs-on: ubuntu-latest
+  if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')

    steps:
      - uses: actions/checkout@v2
        with:
          ref: develop
+        fetch-depth: 0

      - 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 }}

CircleCi is… I don’t know about that very much😅

Additional context Or add step when use npx shipjs setup. Do you want to use "Release Snapshot"? y/N. If we add this step, we should refactor addCircleCIConfig.js and addGitHubActions.js.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
eunjae-leecommented, Jun 22, 2020

@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

0reactions
tyankatsu0105commented, Jun 21, 2020

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Finding and customizing actions - GitHub Docs
Actions are the building blocks that power your workflow. A workflow can contain actions created by the community, or you can create your...
Read more >
GitHub actions templates - Codewrecks
A better approach is creating one single template repository and then reuse that repository as action template in other repositories. Usually ...
Read more >
GitHub Actions Performance Improvement for your CI/CD
Caching node_modules in Workflow. Below is one example how can you add actions/cache@v2 action in your GitHub workflow. We want to cache ...
Read more >
Improve Your DevOps Workflow With GitHub Actions
Inside that file, add the following: name: example # Run this workflow every time a new commit pushed to your repository on: push...
Read more >
Creating Custom GitHub Actions - This Dot Labs
Since its generally available release in Nov 2019, Github Actions has seen an incredible increase in adoptions. Github Actions allows you to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found