Skip to content

chore(deps-dev): Bump express in /search/search-dev-tools (#5388) #3

chore(deps-dev): Bump express in /search/search-dev-tools (#5388)

chore(deps-dev): Bump express in /search/search-dev-tools (#5388) #3

name: Search Dev Tools
on:
push:
paths:
- 'search/search-dev-tools/**'
- '.github/workflows/search-dev-tools.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
search-dev-tools:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out source code
uses: actions/[email protected]
with:
token: ${{ secrets.WPCOM_VIP_BOT_TOKEN }}
- name: Setup Node
uses: actions/[email protected]
with:
node-version: 'lts/*'
cache: npm
cache-dependency-path: search/search-dev-tools/package-lock.json
- name: Install dependencies
run: npm ci --ignore-scripts
working-directory: search/search-dev-tools
- name: Build files
run: npm run build
working-directory: search/search-dev-tools
- name: Check the diff
run: |
if [ "$(git diff --ignore-space-at-eol search/search-dev-tools/ | wc -l)" -gt "0" ]; then
echo "::warning::There are changes in the built files."
if [ "${{ github.event.head_commit.committer.email }}" != "[email protected]" ]; then
git config user.name "WordPress VIP Bot"
git config user.email [email protected]
git config push.default "current"
git add search/search-dev-tools/
git commit -m "Regenerate the bundle"
git push
else
echo "::error::Aborting to avoid the loop."
exit 1
fi
fi
env:
GH_TOKEN: ${{ secrets.WPCOM_VIP_BOT_TOKEN }}