Skip to content

feat: Change backend-proxy-middleware-cf to use approuter instead of token exchange #63658

feat: Change backend-proxy-middleware-cf to use approuter instead of token exchange

feat: Change backend-proxy-middleware-cf to use approuter instead of token exchange #63658

Workflow file for this run

name: Lint with auto fix
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
jobs:
run-linters:
# Skip this job on forks since it requires secrets and push permissions
if: github.event.pull_request.head.repo.full_name == github.repository
strategy:
matrix:
os: [ubuntu-latest]
node-version: [20.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code repository
uses: actions/checkout@v6
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.ACCESS_PAT }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: |
- args: [--ignore-scripts]
- name: Cache pnpm modules
uses: actions/cache@v4
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm modules
run: pnpm install --frozen-lockfile
- name: Run build
run: pnpm run build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Run lint:fix
run: pnpm run lint:fix
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Commit lint fixes if any
run: |
git config --global user.name github-actions[bot]
git config --global user.email github-actions[bot]@users.noreply.github.com
git add pnpm-lock.yaml
if git commit -m "Linting auto fix commit" -a --no-verify; then
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r HEAD)
if ! git push; then
echo "::error::Failed to push lint fixes to remote repository. The commit was created locally but could not be pushed."
echo "::error::Files that could not be committed: $CHANGED_FILES"
echo "Fix the eslint issues locally and push the changes."
exit 1
fi
echo "Lint fixes committed and pushed successfully"
else
echo "No lint fixes needed"
fi