Preview publish package

Designed to automate the process of building and publishing a preview version of a exile.watch package to a GitHub NPM registry, enabling users to test and evaluate changes before the final release

exile.watch

This page covers preview-publish-package*actions

Usage

In .github/workflows/preview-publish-package.yml paste following snippet:

name: "Preview publish: @exile-watch / doryani"

on:
  pull_request_target:
    types:
      - labeled

jobs:
  preview-publish-package:
    runs-on: ubuntu-latest
    if: contains(github.event.pull_request.labels.*.name, 'preview-publish')
    steps:
      - name: Checkout source code
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.GH_TOKEN }}
          fetch-depth: 0
          ref: ${{ github.event.pull_request.head.ref }}

      - name: Preview publish package
        uses: exile-watch/doryani/preview-publish-package@main
        with:
          GH_ACTOR: ${{ github.actor }}
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
          prRef: ${{ github.event.pull_request.head.ref }}

Sub-actions

Action code
Name

Create status comment

Creates status comment after preview-publish label is applied to the branch

Publish prerelease

Creates prerelease in x.x.x-preview.x format and publishes to github registry

Update status comment on success

Once the package is published, this action updates the status comment created in 00

Update status comment on failure

If 00 or 01 action fails, this action updates the status created in 00

Remove preview publish label

Removes preview-publish label from PR once 00 is completed

Last updated

Was this helpful?