Update release notes #544
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: Update release notes | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '00 00 * * *' | |
# At 00:00 everyday | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
update-bom: | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
ref: main | |
- name: Check existing PRs | |
run: | | |
if gh pr list --repo ${{ github.server_url }}/${{ github.repository }} --json title | grep 'Updating release notes'; then | |
gh run cancel ${{ github.run_id }} | |
gh run watch ${{ github.run_id }} | |
else | |
echo "Not found existing PRs" | |
fi | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Yarn install | |
run: yarn install | |
- name: Update releases notes | |
run: node .github/scripts/release_notes/index.js ${{ secrets.GITHUB_TOKEN }} | |
- name: Check release-notes/index.md | |
run: | | |
if git diff --exit-code ./src/pages/home/release-notes/index.md; then | |
gh run cancel ${{ github.run_id }} | |
gh run watch ${{ github.run_id }} | |
else | |
echo "./src/pages/home/release-notes/index.md -> no update" | |
fi | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Pull Request | |
uses: peter-evans/[email protected] | |
with: | |
token: ${{ github.token }} | |
commit-message: Updating release notes | |
branch: update-release-notes | |
delete-branch: true | |
labels: | | |
release-notes | |
automated pr | |
title: "Updating release notes" | |
body: This PR is automatically created by [update-release-notes] action. | |