Skip to content

feat: add skill for sap fiori elements development #68986

feat: add skill for sap fiori elements development

feat: add skill for sap fiori elements development #68986

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: [22.x]
runs-on: ${{ matrix.os }}
environment: ci-secrets
steps:
- name: Checkout code repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.ACCESS_PAT }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: ${{ matrix.node-version }}
- name: Setup pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
- name: Cache pnpm modules
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # 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: 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