Bump @eslint/js from 8.57.0 to 9.0.0 #415
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: Build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
npm-scripts: | |
name: npm scripts | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} | |
- name: Bump version | |
run: | | |
APP_VERSION=$(jq -r .version .homeycompose/app.json) | |
jq ".version=\"$APP_VERSION\"" package.json > package.json.tmp | |
mv package.json.tmp package.json | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-node-modules- | |
save-always: true | |
- name: Update package-lock.json | |
run: npm install | |
- name: Lint and fix errors, and format code | |
run: npm run lint:fix | |
- name: Commit changes | |
run: | | |
git config --local user.name "GitHub Actions" | |
git config --local user.email "[email protected]" | |
git add -A | |
if ! git diff --cached --exit-code; then | |
git commit -m "Code maintenance: bump version, lint and format" | |
if [[ ${{ github.ref }} == "refs/heads/main" ]]; then | |
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token | |
BRANCH_NAME="maintenance-$(date +'%Y%m%d%H%M%S')" | |
git checkout -b $BRANCH_NAME | |
git push origin $BRANCH_NAME | |
gh pr create --base main --head $BRANCH_NAME --title "Maintenance PR" --body "Automatic code maintenance: bump version, lint and format." | |
gh pr merge --auto --squash --delete-branch ${{ github.event.pull_request.html_url }} | |
else | |
git pull origin ${{ github.head_ref }} --rebase | |
git push origin HEAD:${{ github.head_ref }} | |
fi | |
else | |
echo "No changes to commit." | |
fi | |
homey: | |
name: Homey | |
needs: npm-scripts | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-node-modules- | |
save-always: true | |
- name: Install dependencies | |
run: npm ci | |
- name: Build app # Compile TypeScript | |
run: npm run build | |
sonarcloud: | |
name: SonarCloud | |
needs: npm-scripts | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-node-modules- | |
save-always: true | |
- name: Install dependencies | |
run: npm ci | |
- name: Scan code | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
dependabot: | |
name: Dependabot | |
needs: [homey, sonarcloud] | |
runs-on: ubuntu-latest | |
if: ${{ github.actor == 'dependabot[bot]' }} | |
steps: | |
- name: Fetch metadata | |
id: metadata | |
uses: dependabot/fetch-metadata@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Auto-merge | |
run: gh pr merge --auto --merge $PR_URL | |
env: | |
PR_URL: ${{ github.event.pull_request.html_url }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |