Skip to content

feat(typos): version 1.28.2 - November 2024 dictionary update #18

feat(typos): version 1.28.2 - November 2024 dictionary update

feat(typos): version 1.28.2 - November 2024 dictionary update #18

Workflow file for this run

name: Dependabot Auto-merge
on:
pull_request:
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2
- name: Set PR title for typos-cli updates
if: contains(steps.dependabot-metadata.outputs.dependency-names, 'typos-cli')
uses: actions/github-script@v7
env:
NEW_VERSION: ${{ steps.dependabot-metadata.outputs.new-version }}
with:
script: |
const prBody = context.payload.pull_request.body;
const prNumber = context.payload.pull_request.number;
const newVersion = process.env.NEW_VERSION;
// Find line with dictionary update, eg: "Updated the dictionary with the November 2024 changes"
let dict_date;
const dictionaryRegex = /(Updated the dictionary.*)/;
const dateRegex = /(?:January|February|March|April|May|June|July|August|September|October|November|December)\s+\d{4}/;
for (const line of prBody.split('\n')) {
const match = line.match(dictionaryRegex);
if (match) {
const dateMatch = match[1].match(dateRegex);
dict_date = dateMatch ? dateMatch[0] : '';
break;
}
}
const title = `feat(typos): version ${newVersion}` + (dict_date ? ` - ${dict_date} dictionary update` : '');
console.log(title);
// Update the PR title
await github.rest.pulls.update({
...context.repo,
pull_number: prNumber,
title: title
});
result-encoding: string
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL" --body ""
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}