fix: scroll to top not working #92
Workflow file for this run
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: linter-check | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
permissions: | |
contents: write | |
pull-requests: write | |
id-token: write | |
actions: write | |
jobs: | |
linters: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.VITE_SPA_STARTER_ACTION }} | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: node-modules-${{ hashFiles('package-lock.json') }} | |
- name: Install dependencies | |
run: npm install | |
- name: Run linters fix | |
run: | | |
npm run prettier:fix | |
npm run lint:fix | |
- name: Check for changes | |
id: git_diff | |
run: | | |
git diff --exit-code || echo "changed=1" >> $GITHUB_OUTPUT | |
- name: Commit if code changed by linter | |
if: ${{ steps.git_diff.outputs.changed == 1 }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
PR_NUMBER: ${{ github.event.number }} | |
run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" | |
git add . | |
git commit -m "chore: fix code style issues with linters" | |
git push | |
gh pr comment ${{ env.PR_NUMBER }} --body "🪄 Code formatted, commit: $(git rev-parse --short HEAD)." | |
- name: Check linters | |
if: ${{ steps.git_diff.outputs.changed != 1 }} | |
run: | | |
npm run prettier | |
npm run lint |