Skip to content

Fix broken category links when removing category base #2

Fix broken category links when removing category base

Fix broken category links when removing category base #2

name: CI
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
search-dev-tools:
name: Build Search Dev Tools
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 }}