bot_update_exclusions #75
This file contains hidden or 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: 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@v6 | |
| - name: 🎯 Setup Dart | |
| uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: "3.10.0" | |
| - 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 for exclusion table | |
| if: ${{ env.did_change == 'true' }} | |
| run: dart lib/exclusion_reason_table.dart | |
| - name: 📝 Create Pull Request for exclusion table | |
| if: ${{ env.did_change == 'true' }} | |
| uses: peter-evans/[email protected] | |
| with: | |
| base: main | |
| branch: chore/update-exclusion-table | |
| 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]> | |
| token: ${{ steps.generate-token.outputs.token }} | |
| sign-commits: true | |
| - name: 🔍 Check for deprecated rules changes | |
| id: deprecated | |
| run: (dart bin/analyze.dart --set-exit-if-changed && echo "deprecated_rules_changed=false" >> $GITHUB_ENV) || echo "deprecated_rules_changed=true" >> $GITHUB_ENV | |
| - name: ✍️ Remove deprecated rules | |
| if: ${{ env.deprecated_rules_changed == 'true' }} | |
| run: dart bin/remove_deprecated_rules.dart | |
| - name: 📝 Create Pull Request for deprecated rules | |
| if: ${{ env.deprecated_rules_changed == 'true' }} | |
| uses: peter-evans/[email protected] | |
| with: | |
| base: main | |
| branch: feat/remove-deprecated-rules | |
| commit-message: "feat: remove deprecated rules" | |
| title: "feat: remove deprecated rules" | |
| body: | | |
| There are now rules deprecated that require an update to the Very Good Analysis. | |
| labels: bot | |
| author: VGV Bot <[email protected]> | |
| assignees: vgvbot | |
| committer: VGV Bot <[email protected]> | |
| token: ${{ steps.generate-token.outputs.token }} | |
| sign-commits: true |