add-word #390
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: add-word | |
on: | |
workflow_dispatch: | |
inputs: | |
word: | |
description: A word | |
required: true | |
type: string | |
jobs: | |
add-word: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate token | |
id: generate-token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.PRIVATE_KEY }} | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up sd | |
uses: kenji-miyake/setup-sd@v2 | |
- name: Update .cspell.json | |
run: | | |
sd -s \ | |
'"words": [' \ | |
'"words": [ | |
"${{ inputs.word }}",' \ | |
.cspell.json | |
- name: Create PR | |
id: create-pr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
base: ${{ github.event.repository.default_branch }} | |
branch: add-word-${{ inputs.word }} | |
title: "feat(words): add ${{ inputs.word }}" | |
commit-message: "feat(words): add ${{ inputs.word }}" | |
body: | | |
TODO: Update this comment and add some reference links. | |
your usage of the word: [link of github or something]() | |
The documentation for the word: [link for word documentation]() | |
> [!NOTE] | |
> To get approval, you need to show external documentation proving that the word is not your own creation, but is common in the public and industry. | |
> Please check [CONTRIBUTING.md](https://github.com/tier4/autoware-spell-check-dict/blob/main/CONTRIBUTING.md) for detail. | |
labels: | | |
bot | |
words | |
signoff: true | |
delete-branch: true | |
- name: Check outputs | |
run: | | |
echo "Pull Request Number - ${{ steps.create-pr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.create-pr.outputs.pull-request-url }}" | |
- name: Enable auto-merge | |
if: ${{ steps.create-pr.outputs.pull-request-operation == 'created' }} | |
run: gh pr merge --squash --auto "${{ steps.create-pr.outputs.pull-request-number }}" | |
env: | |
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |