Skip to content

bot_update_exclusions #136

bot_update_exclusions

bot_update_exclusions #136

name: bot_update_exclusions
on:
# This should ideally trigger whenever there is a commit to the [Dart Linter rules](https://raw.githubusercontent.com/dart-lang/sdk/main/pkg/linter/tool/machine/rules.json).
# However, this is not yet possible see: https://github.com/orgs/community/discussions/26323
schedule:
# At 08:06 on every day-of-week from Monday through Friday.
- cron: "6 8 * * 1-5"
workflow_dispatch:
jobs:
build:
defaults:
run:
working-directory: tool/linter_rules
runs-on: ubuntu-latest
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
- name: 🎯 Setup Dart
uses: dart-lang/setup-dart@v1
- name: 📦 Install Dependencies
run: dart pub get
- name: 🔍 Check for exclusions changes
id: make
run: (dart lib/exclusion_reason_table.dart --set-exit-if-changed && echo "did_change=false" >> $GITHUB_ENV) || echo "did_change=true" >> $GITHUB_ENV
- name: 🔑 Config Git User
if: ${{ env.did_change == 'true' }}
run: |
git config user.name VGV Bot
git config user.email [email protected]
- name: ✍️ Make changes
if: ${{ env.did_change == 'true' }}
run: dart lib/exclusion_reason_table.dart
- name: 📝 Create Pull Request
if: ${{ env.did_change == 'true' }}
uses: peter-evans/[email protected]
with:
base: main
branch: chore/update-spdx-license
commit-message: "docs: update exclusion table"
title: "docs: update exclusion table"
body: |
There are rules that require an update to their exclusion reasons.
labels: bot
author: VGV Bot <[email protected]>
assignees: vgvbot
committer: VGV Bot <[email protected]>