Collect Release Notes #22
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: Collect Release Notes | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: '0 6 * * 1' # every Monday at 6:00 AM | |
env: | |
MINORS: "v1.28 v1.29 v1.30 v1.31" | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
collect-all: | |
if: github.repository == 'rancher/rke2-docs' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Remove old release notes | |
run: | | |
for minor in $MINORS; do | |
rm docs/release-notes/$minor*.md | |
done | |
- name: Generate release notes | |
run: scripts/collect-all-release-notes.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get current month and year | |
id: date | |
run: echo "month_year=$(date +'%B %Y')" >> $GITHUB_ENV | |
- name: Commit release notes | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git checkout -b update-release-notes | |
git add docs/release-notes/* | |
git commit -s -m "update release-notes/v1.XX.X.md" | |
git push -f --set-upstream origin update-release-notes | |
- name: Create pull request | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh pr create --title "Update release notes for $month_year" \ | |
--body "Automated release notes update" --base main --repo ${{ github.repository }} | |