Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@qiwi/semrel-metabranch

qiwi1.2kMIT3.1.3TypeScript support: included

Semrel plugin for two-way data sync with remote branch

readme

@qiwi/semrel-metabranch

Semrel plugin for two-way data sync with any remote branch on any release step.

Step Description
verifyConditions Performs actions as declared in step options.
analyzeCommits As prev.
verifyRelease ...
generateNotes ...
prepare ...
publish ...
addChannel ...
success ...
fail ...

Install

`shell script yarn add @qiwi/semrel-metabranch -D


## Usage
As a part of plugin declaration:
```json
// .release.rc
{
  "plugins": [[
    "@qiwi/semrel-multibranch",
    {
      "verify": {
        "action": "fetch",
        "branch": "metabranch",
        "from": "foo",
        "to": "bar"
      }
    }
  ]]
}

Action declared in release step:

{
  "publish": [[
    "@qiwi/semrel-multibranch",
    {
      "action": "push",
      "branch": "metabranch",
      "from": "foo/**/*.txt",
      "to": "bar",
      "message": "commit message"
    }
  ]]
}

GitHub Pages docs pushing example

module.exports = {
  debug: true,
  branch: 'master',
  plugins: [
    [
      '@qiwi/semrel-metabranch',
      {
        publish: {
          action: 'push',
          branch: 'gh-pages',
          from: './docs',
          to: '.',
          message: 'update docs ${nextRelease.gitTag}'
        }
      }
    ],
    ...
  ]
}

Configuration

Environment variables
Variable Description
GH_TOKEN or GITHUB_TOKEN Required. The token used to authenticate with GitHub.
Options
Option Description Default
action Action to perform: fetch/push
branch Branch to push metabranch
message Commit message powered by lodash.template: docs <%= nextRelease.gitTag %> update meta
from Source glob pattern . (root)
to Destination directory . (root)

API

TActionOptions

export type TBaseActionOptions = {
  branch: string
  from: string | string[]
  to: string
  message: string
}

export type TActionOptionsNormalized = TBaseActionOptions & {
  repo: string
  cwd: string
  temp: string
}

export type TActionType = 'fetch' | 'push'

export type TActionOptions = Partial<TActionOptionsNormalized> & {
  repo: string
}

export type TPluginOptions = Partial<TBaseActionOptions> & {
  action: TActionType
}

Defaults

export const branch = 'metabranch'
export const from = '.'
export const to = '.'
export const message = 'update meta'

export const defaults = {
  branch,
  from,
  to,
  message,
}

License

MIT

changelog

@qiwi/semrel-metabranch 3.1.2 (2022-05-09)

Bug Fixes

Performance Improvements

Dependencies

  • @qiwi/semrel-plugin-creator: upgraded to 2.3.2
  • @qiwi/semrel-testing-suite: upgraded to 3.1.2

@qiwi/semrel-metabranch 3.1.1 (2022-04-09)

Bug Fixes

Dependencies

  • @qiwi/git-utils: upgraded to 1.1.1
  • @qiwi/semrel-common: upgraded to 3.4.1
  • @qiwi/semrel-plugin-creator: upgraded to 2.3.1
  • @qiwi/semrel-infra: upgraded to 3.2.1
  • @qiwi/semrel-testing-suite: upgraded to 3.1.1

@qiwi/semrel-metabranch 3.1.0 (2022-03-12)

Features

  • exclude git-utils from common assets (7cd7eab)

Dependencies

  • @qiwi/git-utils: upgraded to 1.1.0
  • @qiwi/semrel-common: upgraded to 3.4.0
  • @qiwi/semrel-plugin-creator: upgraded to 2.3.0
  • @qiwi/semrel-infra: upgraded to 3.2.0
  • @qiwi/semrel-testing-suite: upgraded to 3.1.0

@qiwi/semrel-metabranch 3.0.6 (2022-03-06)

Dependencies

  • @qiwi/semrel-common: upgraded to 3.3.0
  • @qiwi/semrel-plugin-creator: upgraded to 2.2.6
  • @qiwi/semrel-infra: upgraded to 3.1.0
  • @qiwi/semrel-testing-suite: upgraded to 3.0.6

@qiwi/semrel-metabranch 3.0.5 (2022-03-06)

Dependencies

  • @qiwi/semrel-common: upgraded to 3.2.7
  • @qiwi/semrel-plugin-creator: upgraded to 2.2.5
  • @qiwi/semrel-infra: upgraded to 3.0.8
  • @qiwi/semrel-testing-suite: upgraded to 3.0.5

3.0.4 (2022-02-22)

Bug Fixes

3.0.3 (2021-12-29)

Bug Fixes

  • fix globs on windows via @qiwi/multi-semantic-release update (c4d9278)

3.0.2 (2021-12-23)

3.0.1 (2021-12-22)

3.0.0 (2021-11-17)

Bug Fixes

  • up deps to fix internal esm-cjs interop (830ac9d)

Features

BREAKING CHANGES

  • common: dropped legacy require API

2.1.0 (2021-10-28)

Bug Fixes

Features

  • preset: update semrel-gh-pages plugin (b78f0c6)

2.0.0 (2021-09-27)

Performance Improvements

BREAKING CHANGES

  • require semrel >=18, require Node.js >= 14.17

1.6.7 (2021-08-25)

1.6.6 (2021-07-07)

Bug Fixes

1.6.5 (2021-06-18)

1.6.4 (2021-06-17)

Bug Fixes

  • package: update deps, fix vuls (c94e353)

1.6.3 (2021-05-17)

Bug Fixes

  • deps: up deps, fix vulns (c718296)

1.6.2 (2021-04-04)

Performance Improvements

1.6.1 (2021-04-02)

Performance Improvements

1.6.0 (2021-04-02)

Features

  • metabranch: add template for commit message, other refactorings (382e0f7), closes #35

1.5.0 (2021-04-02)

Features

  • metabranch: inherit git user env for commits (f37852e)

Performance Improvements

1.4.4 (2021-04-02)

1.4.3 (2021-03-22)

1.4.2 (2021-03-12)

Performance Improvements

  • deps: update semrel to 17.4.2 (e25c584)

1.4.1 (2021-03-11)

Bug Fixes

Performance Improvements

  • cross-package refactorings (3defc27)

@qiwi/semrel-metabranch 1.4.0 (2021-01-21)

Features

  • metabranch: exclude regular dirs from glob pattern (619a6c4)

@qiwi/semrel-metabranch 1.3.3 (2021-01-19)

Bug Fixes

  • metabranch: rm fallback HEAD checkout (e0eb1d8)

@qiwi/semrel-metabranch 1.3.2 (2021-01-19)

Performance Improvements

  • metabranch: log temp dir contents on empty git status result (26f309b)

1.3.1 (2021-01-19)

Bug Fixes

  • metabranch: check git status before commit (5a7b6f8)

1.3.0 (2021-01-19)

Bug Fixes

  • metabranch: fix git add pattern (a68c885)

Features

1.2.2 (2021-01-19)

Bug Fixes

  • metabranch: fix module exports (b3c2399)

@qiwi/semrel-metabranch 1.2.1 (2021-01-19)

Performance Improvements

  • metabranch: add some debug notes (7e4bfee)

@qiwi/semrel-metabranch 1.2.0 (2021-01-19)

Features

  • metabranch: add debugger (5180777)

Dependencies

  • @qiwi/semrel-plugin-creator: upgraded to 1.5.0

@qiwi/semrel-metabranch 1.1.0 (2021-01-19)

Features

  • metabranch: handle dry-run option (62e8add), closes #27

@qiwi/semrel-metabranch 1.0.0 (2021-01-19)

Bug Fixes

  • metabranch: skip action if step config is empty (700a8fc)

Features

  • metabranch: handle push racing (d3833b6)
  • metabranch: introduce metabranch plugin pkg (a00c67d)
  • metabranch: provide commit msg configuration (02bbc4d)
  • metabranch: support glob pattern for push action (f6a0363)
  • metabranch: support glob patterns for push (3539eae)

Dependencies

  • @qiwi/semrel-plugin-creator: upgraded to 1.4.0