Verify the pull request along with the modifications for the Bit components.
This task creates a Bit lane and adds the component changes for you to verify any components inside a Pull request.
Optional The workspace directory path from the root. Default "Dir specified in Init Task or ./"
.
Optional When set to true, adds labels to the PR with component versions. Default false
. Available in v2+.
The labels are automatically added in the format component-id@auto
for all new and modified components. You can then modify these labels in the PR to control version bumping:
org.scope/component@auto
- Uses the default 'patch' bump or automatically uses the version bump specified through:- Pull Request Labels: Use the keyword directly (e.g.,
major
) or enclosed within square brackets (e.g.,[major]
) - Pull Request or Commit Title: Include the version keyword in square brackets (e.g.,
feat: new button [major]
)
- Pull Request Labels: Use the keyword directly (e.g.,
org.scope/component@patch
- Forces a patch version bumporg.scope/component@minor
- Forces a minor version bumporg.scope/component@major
- Forces a major version bump
Supported version keywords are: major
, minor
, and patch
.
Example:
- Initial auto-added label:
my-org.my-scope/ui/button@auto
- Modified to force minor bump:
my-org.my-scope/ui/button@minor
Note: Use bit-task/init@v1
as a prior step in your action before running bit-tasks/pull-request@v2
.
name: Test Bit Pull Request
on:
pull_request:
types:
- opened
- synchronize
permissions:
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_USER_NAME: ${{ secrets.GIT_USER_NAME }}
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
BIT_CONFIG_ACCESS_TOKEN: ${{ secrets.BIT_CONFIG_ACCESS_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize Bit
uses: bit-tasks/init@v1
with:
ws-dir: '<WORKSPACE_DIR_PATH>'
- name: Bit Pull Request
uses: bit-tasks/pull-request@v2
with:
version-labels: true # Optional: Add version labels to PR
Steps to create custom tasks in different CI/CD platforms.
Go to the GithHub action task directory and build using NCC compiler. For example;
npm install
npm run build
git commit -m "Update task"
git tag -a -m "action release" v2 --force
git push --follow-tags
For more information, refer to Create a javascript action