chore(main): release 0.1.33 #28
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: | |
types: [opened] | |
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 with feat prefix 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 dictionary date from line like "Updated the dictionary with the November 2024 changes" | |
let dict_date; | |
const regex = /Updated the dictionary.*?((?: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(regex); | |
if (match) { | |
dict_date = match[1]; | |
break; | |
} | |
} | |
// Set PR title with feat prefix and dictionary date (if any) | |
const title = `feat(typos): version ${newVersion}` + (dict_date ? ` - ${dict_date} dictionary update` : ''); | |
console.log(title); | |
await github.rest.pulls.update({ | |
...context.repo, | |
pull_number: prNumber, | |
title: title | |
}); | |
- 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}} |