Check news #41322
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: Check news | |
on: | |
schedule: | |
# The shortest interval you can run scheduled workflows is once every 5 minutes. https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
- cron: '*/5 * * * *' | |
jobs: | |
update: | |
name: Update | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: master | |
- name: Set up Node LTS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Install dependencies | |
run: yarn install | |
- name: Update news | |
run: yarn news:update | |
- name: Save last title to output | |
run: | | |
echo "LAST_TITLE=$(cat news.min.json | grep -oP '(?<="title":").*?[^\\](?=",)' | head -1)" >> $GITHUB_OUTPUT | |
id: title | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: 'chore: π€ Update news β ${{ steps.title.outputs.LAST_TITLE }}' | |
author_name: GitHub Actions | |
author_email: [email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |