fix(english_25k): moved british spellings to britishenglish file (@AnnaBuchholz) #157
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: Prettier Fix | |
env: | |
PNPM_VERSION: "9.6.0" | |
NODE_VERSION: "20.16.0" | |
permissions: | |
contents: write | |
pull-requests: write | |
on: | |
pull_request_target: | |
types: [labeled] | |
jobs: | |
prettify: | |
runs-on: ubuntu-latest | |
if: github.event.label.name == 'prettify' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
- name: Install prettier | |
run: pnpm add -g [email protected] | |
- name: Get changed files | |
id: get-changed-files | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const changedFiles = await github.paginate( | |
github.rest.pulls.listFiles, | |
{ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.payload.pull_request.number, | |
} | |
); | |
return changedFiles.filter(file=> file.status !== "removed").map(file => file.filename).join(' '); | |
- name: Run Prettier fix | |
run: | | |
CHANGED_FILES=$(echo ${{ steps.get-changed-files.outputs.result }}) | |
if [ -n "$CHANGED_FILES" ]; then | |
pnpm prettier --write $CHANGED_FILES | |
fi | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "prettier fix" | |
branch: ${{ github.event.pull_request.head.ref }} | |
- name: Remove label | |
uses: actions-ecosystem/action-remove-labels@v1 | |
with: | |
labels: prettify |