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.

v16.0.0-beta.18 & Git Plugin - Edge Case

See original GitHub issue

I’m setting up a workflow as described here: https://github.com/semantic-release/semantic-release/blob/beta/docs/usage/workflow-configuration.md

I have two pre-release branches:

  • dev
  • test

test was ahead of dev with a few fix commits. In addition to those manual commits, as a result of using semantic-release/git plugin, the latest commit in the test branch was done by semantic-release-bot and contained [skip ci] text in commit message.

After merging test to dev the release process in dev branch has failed. This happened because the tip of the dev was ahead of the commit that Travis checked out. It was the git plugin that failed. It failed because of the classic “you should pull first” git error. Travis ignored the latest commit done by semantic-release/git plugin in test branch. I presume it ignored it because of the [skip ci] message.

This probably can be easily fixed by removing [skip ci] from the commit message template in the semantic-release/git plugin, and then using if condition somewhere inside .travis.yml.

I believe that the documentation of the git plugin should mention that edge case somewhere. Or maybe even stop suggesting usage of [skip ci]. Otherwise the plugin should pull … which I think might lead to other kind of problems.

Config

module.exports = {
  branches: [
    //
    '+([1-9])?(.{+([1-9]),x}).x',
    { name: 'release' },
    { name: 'master', channel: 'dev', prerelease: true },
    { name: 'test', prerelease: true },
  ],
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',
    [
      '@semantic-release/npm',
      {
        npmPublish: false,
        tarballDir: './',
      },
    ],
    [
      '@semantic-release/git',
      {
        assets: ['package.json'],
        message:
          'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
      },
    ],
    [
      '@semantic-release/github',
      {
        assets: [
          {
            path: ['package-*.tgz'],
            label: 'Build',
          },
        ],
      },
    ],
  ],
};

Travis

language: node_js
cache:
  yarn: true
  directories:
    - node_modules
node_js:
  - '10'
branches:
  except:
    - /^v\d+\.\d+\.\d+$/
before_install:
  - curl -o- -L https://yarnpkg.com/install.sh | bash
  - export PATH="$HOME/.yarn/bin:$PATH"
jobs:
  include:
    - stage: test, build and deploy
      script:
        - yarn build
      deploy:
        - provider: script
          script:
            - yarn semantic-release
          skip_cleanup: true
          on:
            branch:
              - master
              - dev
              - test

Versions in package.json:

...
  "@semantic-release/git": "7.1.0-beta.3",
  "semantic-release": "16.0.0-beta.18"
...

Steps

  1. git checkout -b dev
  2. git push origin
  3. git checkout -b test
  4. git commit -m 'fix: fixes this or that'
  5. git push origin
  6. ⏲ wait for release from test branch
  7. git checkout dev
  8. git merge origin/test
  9. git push origin
  10. ❗ Latest push to test would fail to produce new release with error similar to:
error: failed to push some refs to XXX
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pvdlgcommented, Dec 11, 2019

No because the last commit would be the merge commit. Travis care about [skip ci] only if it’s the head commit.

0reactions
semantic-release-botcommented, Jan 9, 2020

🎉 This issue has been resolved in version 8.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

com.microsoft.Edge.yaml - GitHub
Edge /com.microsoft.Edge.yaml. Go to file · Go to file T
Read more >
Release notes for Microsoft Edge Beta Channel
These release notes provide information about new features and non-security updates that are included in the Microsoft Edge Beta Channel.
Read more >
Extension for Microsoft Edge - UiPath Documentation Portal
This extension helps you create browser automations in Microsoft Edge. You can install this extension in multiple ways, as shown below: Install from...
Read more >
The git from semantic-release - GithubHelp
twisted_rightwards_arrows: semantic-release plugin to commit release assets to the project's git repository ... v16.0.0-beta.18 & Git Plugin - Edge Case.
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