Skip to content

Commit

Permalink
👷 Add latest-changes workflow action (#203)
Browse files Browse the repository at this point in the history
👷 Add `latest-changes` workflow action
  • Loading branch information
yezz123 authored Apr 10, 2024
2 parents bada5a4 + 03ef054 commit 5ac104f
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/latest-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Use the latest-changes action to generate a release.md file with the latest changes.

# Thanks to @tiangolo for the original action, [see here](https://github.com/tiangolo/fastapi/blob/master/.github/workflows/latest-changes.yml).


name: Latest Changes

on:
pull_request_target:
branches:
- main
types:
- closed
workflow_dispatch:
inputs:
number:
description: PR number
required: true
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: 'false'

jobs:
latest-changes:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
with:
# To allow latest-changes to commit to the main branch
token: ${{ secrets.GITHUB_TOKEN }}
# Allow debugging with tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
with:
limit-access-to-actor: true
- uses: docker://tiangolo/latest-changes:0.3.0
# - uses: tiangolo/latest-changes@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
latest_changes_file: docs/release.md
latest_changes_header: '## Latest Changes'
end_regex: '^## '
debug_logs: true
label_header_prefix: '### '
3 changes: 3 additions & 0 deletions docs/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Release Notes

## Latest Changes
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ nav:
- Frequently Asked Questions: faq.md
- Code of Conduct: code_of_conduct.md
- License: license.md
- Changelog: release.md

extra:
social:
Expand Down
4 changes: 2 additions & 2 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ tinycss2==1.2.1
# via
# cairosvg
# cssselect2
typer==0.12.1
typer==0.12.3
# via typer-cli
typer-cli==0.12.1
typer-cli==0.12.3
typing-extensions==4.11.0
# via
# griffe-typingdoc
Expand Down
2 changes: 1 addition & 1 deletion requirements/linting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cfgv==3.4.0
# via pre-commit
distlib==0.3.8
# via virtualenv
filelock==3.13.3
filelock==3.13.4
# via virtualenv
identify==2.5.35
# via pre-commit
Expand Down

0 comments on commit 5ac104f

Please sign in to comment.