8000 GitHub - stdlib-js/transform-errors-action: GitHub action to transform full-length error messages to shortened error messages for production.
[go: up one dir, main page]

Skip to content

GitHub action to transform full-length error messages to shortened error messages for production.

License

Notifications You must be signed in to change notification settings

stdlib-js/transform-errors-action

Repository files navigation

Transform Error Messages

A GitHub action to transform full-length error messages to shortened error messages for production.

Example Workflow

name: transform_errors

# Workflow triggers:
on:
  workflow_dispatch:
  push:

# Workflow jobs:
jobs:
  transform:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          repository: 'stdlib-js/string-snakecase'
          ref: main
      - name: Create new `error` branch
        run: |
          git checkout -b error
      - name: Transform Error Messages
        id: transform-error-messages
        uses: stdlib-js/transform-errors-action@main
      - name: Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency
        run: |
          if grep -q '"@stdlib/string-format"' package.json; then
            sed -i "s/\"@stdlib\/string-format\"/\"@stdlib\/error-tools-fmtprodmsg\"/g" package.json
          else
            sed -i "s/\"dependencies\": {/\"dependencies\": {\\n    \"@stdlib\/error-tools-fmtprodmsg\": \"^0.0.x\"/g" package.json
          fi
      - name: Configure git
        run: |
          git config --local user.email "noreply@stdlib.io"
          git config --local user.name "stdlib-bot"
      - name: Commit changes
        run: |
          git add -A
          git commit -m "Auto-generated commit"
      - name: Push changes
        run: |
          SLUG=${{ github.repository }}
          echo "Pushing changes to $SLUG..."
          git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" error --force

License

See LICENSE.

Copyright

Copyright © 2022-2024. The Stdlib Authors.

About

GitHub action to transform full-length error messages to shortened error messages for production.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published
0