Skip to content

Update news.yml

Update news.yml #8

Workflow file for this run

name: Generate NEWS.md
on:
push:
branches:
- main
- develop
workflow_dispatch:
permissions: read-all
jobs:
generate_changelog:
uses: ./.github/workflows/changelog.yml
generate_news:
needs: [generate_changelog]
runs-on: ubuntu-latest
permissions:
contents: write
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install Dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packges: any::pkgload, any::markdown, any::xml2, any::stringr
needs: pkgload
- name: Generate NEWS.md
run: |
Rscript -e 'pak::local_install_deps(".", upgrade=FALSE, ask=FALSE, dependencies = TRUE); pkgload::load_all(); noclocksr::generate_news(output_file = "NEWS.md", input_file = "CHANGELOG.md")'
- name: Commit and push changes
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add NEWS.md
git commit -m "docs: Update NEWS.md" || echo "No changes to commit"
git pull --ff-only
git push origin