Skip to content

Update Release Notes #13

Update Release Notes

Update Release Notes #13

name: Update Release Notes
on:
repository_dispatch:
types: [update-release-notes]
workflow_dispatch:
jobs:
update_release_notes:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install requests beautifulsoup4 GitPython markdownify
- name: Run update script
id: update_script
run: |
python update_release_notes.py
echo "version=$(python update_release_notes.py --get-version)" >> $GITHUB_OUTPUT
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update release notes" || echo "No changes to commit"
- name: Push changes
run: git push origin ${{ steps.update_script.outputs.branch }}
- name: Fetch latest autobrr release
id: fetch_release
run: |
LATEST_RELEASE=$(curl -s https://api.github.com/repos/autobrr/autobrr/releases/latest)
RELEASE_URL=$(echo $LATEST_RELEASE | jq -r .html_url)
echo "release_url=$RELEASE_URL" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
source_branch: ${{ steps.update_script.outputs.branch }}
destination_branch: "main"
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "docs: add release notes for ${{ steps.update_script.outputs.version }}"
pr_body: "Automatically update release notes for version ${{ steps.update_script.outputs.version }}. Latest autobrr release: ${{ steps.fetch_release.outputs.release_url }}"