Skip to content

Update Lint Rules

Update Lint Rules #42

name: Update Lint Rules
on:
workflow_dispatch:
schedule:
# Schedule at 9 AM JST (0 AM UTC) every Friday
- cron: '0 0 * * 5'
jobs:
update:
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get dvm config
uses: blendfactory/dvm-config-action@v2
id: dvm-config-action
- name: Set up dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ steps.dvm-config-action.outputs.dart-sdk-version }}
- name: Install dependencies
run: dart pub get
shell: bash
working-directory: tools/update_lint_rules
- name: Run update_lint_rules
run: dart run bin/update_lint_rules.dart "$GITHUB_WORKSPACE/packages/yumemi_lints/lib"
shell: bash
working-directory: tools/update_lint_rules
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID_OF_YUMEMI_PR_TOKEN_GENERATOR }}
private-key: ${{ secrets.APP_PRIVATE_KEY_OF_YUMEMI_PR_TOKEN_GENERATOR }}
- name: Create a pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate_token.outputs.token }}
author: 'GitHub <[email protected]>'
commit-message: 'auto: Update lint rules'
title: Update lint rules
body: This was automatically generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
base: main
branch: ${{ vars.AUTO_UPDATE_BRANCH_NAME }}
branch-suffix: short-commit-hash