Don't commit changes to .yarnrc.yml. #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ${{ secrets.STYLEBOT_GITHUB_APP_ID }} | |
private-key: ${{ secrets.STYLEBOT_GITHUB_APP_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} | |
# 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 }} | |
``` |