feat(typos): version 1.28.2 - November 2024 dictionary update #13
Workflow file for this run
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: 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}/; | |
const title = `feat(typos): v${newVersion}` + (dict_date ? ` - ${dict_date}` : ''); | |
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: echo gh pr merge --auto --squash "$PR_URL" --body "" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} |