Skip to content

Update component statuses #480

Update component statuses

Update component statuses #480

name: Update component statuses
on:
schedule:
- cron: "0 9 * * *"
workflow_dispatch:
jobs:
cron-update-statuses:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node
uses: ./.github/actions/node
- name: Today date
run: echo "TODAY=$(date '+%Y-%m-%d')" >> $GITHUB_ENV
- name: Setup git identity
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Update component statuses
run: |
yarn check:statuses
git add --all
if git diff-index --quiet HEAD; then
echo "No changes to component statuses. Exiting."
exit 0
else
git checkout -b docs/update-component-statuses
git commit -m "chore: update component statuses"
git push origin docs/update-component-statuses
fi
- name: Create PR
uses: actions/github-script@v6
with:
script: |
github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
head: 'docs/update-component-statuses',
base: 'master',
title: 'chore: update component statuses',
body: `- Automatically generated PR on ${process.env.TODAY}.\n- Updates component statuses`,
maintainer_can_modify: true,
});