Skip to content

Fixes for build.

Fixes for build. #1

Workflow file for this run

name: stylebot
on:
push:
branches:
- main
concurrency:
group: "stylebot"
cancel-in-progress: true
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
fix:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.STYLEBOT_APP_ID }}
private-key: ${{ secrets.STYLEBOT_PRIVATE_KEY }}
- uses: actions/checkout@master
- id: nodeversion
run: echo "::set-output name=version::$(grep nodejs .tool-versions | sed -e 's/[^[:space:]]*[[:space:]]*//')"
- uses: actions/setup-node@v4
with:
node-version: ${{ steps.nodeversion.outputs.version }}
cache: yarn
- run: yarn install --immutable
# Run fixes, save stdout.
- run: |
echo 'ESLINT_RESULTS<<EOF' >> ${GITHUB_ENV}
yarn fix:eslint || true >> ${GITHUB_ENV}
echo 'EOF' >> ${GITHUB_ENV}
- run: |
echo 'PRETTIER_RESULTS<<EOF' >> ${GITHUB_ENV}
yarn fix:prettier >> ${GITHUB_ENV}
echo 'EOF' >> ${GITHUB_ENV}
- run: git restore .yarn .yarnrc.yml
# Make PR from local changes.
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.app-token.outputs.token }}
commit-message: "[stylebot] Fixes for code style"
branch: stylebot/patch
title: "[stylebot] Fixes for code style"
body: |
Stylebot detected automatically fix-able code style issues.
`yarn fix:eslint`:
```
${{ env.ESLINT_RESULTS }}
```
`yarn fix:prettier`:
```
${{ env.PRETTIER_RESULTS }}
```