A GitHub action to transform full-length error messages to shortened error messages for production.
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
See LICENSE.
Copyright © 2022-2024. The Stdlib Authors.