first README draft

This commit is contained in:
Andrea Lamparelli 2022-12-22 16:52:32 +01:00
parent 4faf62d997
commit a894e6404f
5 changed files with 105 additions and 4 deletions

27
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,27 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CI Checks
on:
push:
branches:
- main
jobs:
build:
strategy:
matrix:
node-version: [16]
os: [ubuntu-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test:report

View file

@ -1,7 +1,7 @@
## ##
# Publish new action tag(s) for downstream consumption # Publish new action tag(s) for downstream consumption
## ##
name: Publish name: Publish GitHub Action
# Manual or automatic release # Manual or automatic release
on: on:

View file

@ -1,4 +1,4 @@
name: Publish name: Publish NPM Package
on: on:
workflow_dispatch: workflow_dispatch:

View file

@ -15,9 +15,10 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Setup Node ${{ matrix.node-version }} - name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- run: npm ci - run: npm ci
- run: npm test

View file

@ -0,0 +1,73 @@
<h1 align="center">BPER: Git Backporter</h1>
<h2 align="center">:outbox_tray: :inbox_tray:</h2>
<p align="center">
<a href="https://github.com/lampajr/backporting">
<img alt="GitHub Actions status" src="https://github.com/lampajr/backporting/workflows/CI/badge.svg">
</a>
</p>
---
**BPer** is a [NodeJS](https://nodejs.org/) command line tool that provides capabilities to *backport* [1] pull requests in an automated way. This tool also comes with a predefined GitHub action in order to make CI/CD integration easier for all users.
[1] *backporting* is an action aiming to move a change (usually a commit) from a branch (usually the main one) to another one, which is generally referring to a still maintained release branch. Keeping it simple: it is about to move a specific change or a set of them from one branch to another.
Table of content
----------------
* **[Usage](#usage)**
* **[GitHub Action](#github-action)**
* **[Limitations](#limitations)**
* **[Contributions](#contributions)**
## Usage
### Inputs
## GitHub Action
This action can be used in any GitHub workflow, below you can find a simple example of manually triggered workflow backporting a specific pull request (provided as input).
```yml
name: Pull Request Backporting using BPer
on:
workflow_dispatch:
inputs:
targetBranch:
description: 'Target branch'
required: true
type: string
pullRequest:
description: 'Pull request'
required: true
type: string
dryRun:
description: 'Dry run'
required: false
default: "true"
type: string
jobs:
backporting:
name: "Backporting"
runs-on: ubuntu-latest
steps:
- name: Backporting
uses: lampajr/backporting@main
with:
target-branch: ${{ inputs.targetBranch }}
pull-request: ${{ inputs.pullRequest }}
auth: ${{ secrets.GITHUB_TOKEN }}
dry-run: ${{ inputs.dryRun }}
```
You can also use this action with other events - you'll just need to specify `target-branch` and `pull-request` params.
For a complete description of all inputs see [Inputs section](#inputs).
## Limitations
## Contributions