Bump the website-dependencies group across 1 directory with 3 updates #114
Workflow file for this run
This file contains hidden or 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: Update Biome schema | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| jobs: | |
| update-biome-schema: | |
| # Only run when Dependabot opens a biome-specific PR. | |
| # Dependabot branch names for this package look like: | |
| # dependabot/npm_and_yarn/biomejs/biome-2.4.12 | |
| if: github.actor == 'dependabot[bot]' && contains(github.head_ref, 'biomejs/biome') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout PR branch | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| # A personal access token is used (rather than the default GITHUB_TOKEN) | |
| # so that the commit pushed below triggers other workflows (e.g. accented.yml). | |
| # Pushes authenticated with the default GITHUB_TOKEN don't trigger workflow runs: | |
| # https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow | |
| # The token is stored as a Dependabot secret (not an Actions secret) because | |
| # workflows triggered by Dependabot can only access secrets scoped to Dependabot. | |
| token: ${{ secrets.PERSONAL_GITHUB_TOKEN_DEPENDABOT }} | |
| - name: Extract new biome version | |
| id: version | |
| run: | | |
| VERSION=$(node -e "const {default: pkg} = await import('./package.json', {with: {type: 'json'}}); console.log(pkg.devDependencies['@biomejs/biome'].replace(/[^0-9.]/g, ''))") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Update biome.json schema URL | |
| run: | | |
| sed -i "s|https://biomejs.dev/schemas/[^/]*/schema.json|https://biomejs.dev/schemas/${{ steps.version.outputs.version }}/schema.json|" biome.json | |
| - name: Commit and push if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add biome.json | |
| git commit -m "Update biome.json schema to ${{ steps.version.outputs.version }}" | |
| git push |