bump ts-eslint #382
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: Validate app | |
on: | |
pull_request: | |
push: | |
branches: main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
validate: | |
name: Validate app | |
runs-on: ubuntu-latest | |
if: github.actor != 'dependabot[bot]' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 'latest' | |
cache: 'npm' | |
- name: Lint & format code | |
run: npm ci | |
- name: Build code & validate app | |
uses: athombv/github-action-homey-app-validate@master | |
with: | |
level: publish | |
- name: Commit & push changes | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add -A | |
if ! git diff --cached --exit-code; then | |
git commit -m "Code maintenance: lint, format and build code" | |
if [[ ${{ github.ref }} == "refs/heads/main" ]]; then | |
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: lint, format and build code." | |
PR_URL=$(gh pr view "$BRANCH_NAME" --json url -q '.url') | |
gh pr merge --auto --merge --delete-branch "$PR_URL" | |
else | |
git pull origin ${{ github.head_ref }} --rebase | |
git push origin HEAD:${{ github.head_ref }} | |
fi | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |