Skip to content

feat: add custom field support for Role entity (#5250) #2399

feat: add custom field support for Role entity (#5250)

feat: add custom field support for Role entity (#5250) #2399

Workflow file for this run

name: Generate Docs
# The reference docs under docs/docs/reference are generated from the package
# sources, so they are a build output that happens to be committed. Generation
# happens after merge, on the base branch, because the generator always emits the
# full current state: run it on a PR branch and it pulls in every change that
# earlier merges left ungenerated, filling the PR diff with unrelated files. A PR
# only checks that the generators run and produce valid MDX.
on:
# Lets a maintainer regenerate the base branch by hand, for example after a
# run was skipped or failed.
workflow_dispatch:
push:
branches:
- master
- minor
- major
paths:
- 'packages/**/*.ts'
- 'packages/**/*.tsx'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- master
- minor
- major
paths:
- 'packages/**/*.ts'
- 'packages/**/*.tsx'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# A superseded PR run tells us nothing, so cancel it. A push run commits to the
# base branch, so let it finish: cancelling it would leave the branch's docs
# stale until the next source change happened to come along.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
validate:
name: Validate generated docs
# Nothing is committed here, so this needs no write access and no secrets,
# which means it also covers PRs from forks.
if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- name: Generate and validate docs
uses: ./.github/actions/generate-docs
commit:
name: Generate & commit docs
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
permissions:
contents: write
models: read
steps:
- name: Generate CI Bot Token
id: app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2.2.2
with:
app-id: ${{ secrets.CI_BOT_APP_ID }}
private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }}
# Least privilege: token is only used to commit & push regenerated docs.
permission-contents: write
- name: Checkout
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
token: ${{ steps.app-token.outputs.token }}
# Check out the branch by name rather than the pushed SHA so the
# commit below has an upstream to rebase onto and push to.
ref: ${{ github.ref_name }}
fetch-depth: 0
- name: Generate and validate docs
uses: ./.github/actions/generate-docs
- name: Check for changes
id: diff
run: |
git add docs/
if git diff --cached --quiet; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
# Capture a stat summary + truncated diff for the AI commit message
{
echo 'summary<<DIFF_EOF'
git diff --cached --stat
echo '---'
git diff --cached -- '*.mdx' | head -200
echo 'DIFF_EOF'
} >> "$GITHUB_OUTPUT"
fi
- name: Generate commit message
if: steps.diff.outputs.changed == 'true'
id: ai-message
continue-on-error: true
uses: actions/ai-inference@b81b2afb8390ee6839b494a404766bef6493c7d9 # v1.2.8
with:
model: openai/gpt-4o-mini
max-tokens: 100
system-prompt: |
You generate concise git commit messages in conventional commit format.
Always use the type "docs" with no scope. Write only the commit message
subject line, nothing else. No quotes, no backticks, no explanation.
Keep it under 72 characters. Describe what specifically changed in the
documentation based on the diff provided.
prompt: |
Generate a commit message for these auto-generated documentation changes:
${{ steps.diff.outputs.summary }}
- name: Commit and push generated docs
if: steps.diff.outputs.changed == 'true'
uses: ./.github/actions/commit-and-push
with:
token: ${{ steps.app-token.outputs.token }}
app-slug: ${{ steps.app-token.outputs.app-slug }}
message: "${{ steps.ai-message.outputs.response || 'docs: Generate docs for source changes' }}"