-
Notifications
You must be signed in to change notification settings - Fork 646
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prdoc bot was deleted in #5457 just after being added in #5331 without replacement. Now bringing it back until it is integrated into the new command structure. Formatting is now also fixed, such that the title is always first and the description renders correctly. --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
- Loading branch information
Showing
2 changed files
with
111 additions
and
5 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Command PrDoc | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr: | ||
type: number | ||
description: Number of the Pull Request | ||
required: true | ||
bump: | ||
type: choice | ||
description: Default bump level for all crates | ||
default: "TODO" | ||
required: true | ||
options: | ||
- "TODO" | ||
- "no change" | ||
- "patch" | ||
- "minor" | ||
- "major" | ||
audience: | ||
type: choice | ||
description: Audience of the PrDoc | ||
default: "TODO" | ||
required: true | ||
options: | ||
- "TODO" | ||
- "Runtime Dev" | ||
- "Runtime User" | ||
- "Node Dev" | ||
- "Node User" | ||
overwrite: | ||
type: choice | ||
description: Overwrite existing PrDoc | ||
default: "true" | ||
required: true | ||
options: | ||
- "true" | ||
- "false" | ||
|
||
concurrency: | ||
group: command-prdoc | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
set-image: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
IMAGE: ${{ steps.set_image.outputs.IMAGE }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- id: set_image | ||
run: cat .github/env >> $GITHUB_OUTPUT | ||
cmd-prdoc: | ||
needs: [set-image] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
container: | ||
image: ${{ needs.set-image.outputs.IMAGE }} | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Download repo | ||
uses: actions/checkout@v4 | ||
- name: Install gh cli | ||
id: gh | ||
uses: ./.github/actions/set-up-gh | ||
with: | ||
pr-number: ${{ inputs.pr }} | ||
GH_TOKEN: ${{ github.token }} | ||
- name: Generate PrDoc | ||
run: | | ||
python3 -m pip install -q cargo-workspace PyGithub whatthepatch pyyaml toml | ||
python3 .github/scripts/generate-prdoc.py --pr "${{ inputs.pr }}" --bump "${{ inputs.bump }}" --audience "${{ inputs.audience }}" --force "${{ inputs.overwrite }}" | ||
- name: Report failure | ||
if: ${{ failure() }} | ||
run: gh pr comment ${{ inputs.pr }} --body "<h2>Command failed ❌</h2> Run by @${{ github.actor }} for <code>${{ github.workflow }}</code> failed. See logs <a href=\"$RUN\">here</a>." | ||
env: | ||
RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
GH_TOKEN: ${{ github.token }} | ||
- name: Push Commit | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: Add PrDoc (auto generated) | ||
branch: ${{ steps.gh.outputs.branch }} | ||
file_pattern: 'prdoc/*.prdoc' |