EEWのLPGM実装 #751
Workflow file for this run
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: Auto Format | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- develop | |
jobs: | |
format: | |
env: | |
FLUTTER_VERSION: | |
FLUTTER_CHANNEL: | |
FLUTTER_HOME: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
# https://github.com/actions/checkout | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up ssh | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.SSH_ID_ED25519 }}" | base64 -d > ~/.ssh/id_ed25519 | |
chmod 700 ~/.ssh/id_ed25519 | |
eval $(ssh-agent -s) | |
echo "Host github.com \n\tIdentityFile ~/.ssh/id_ed25519\n\tUser git\n\tIdentityiesOnly yes" >> ~/.ssh/config | |
ssh-keyscan -H github.com >> ~/.ssh/known_hosts | |
- name: Fetch flutter config | |
uses: kuhnroyal/flutter-fvm-config-action@v1 | |
# https://github.com/subosito/flutter-action | |
- name: Set up flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: ${{ env.FLUTTER_CHANNEL }} | |
cache: true | |
cache-key: ${{ env.FLUTTER_VERSION }}-${{ env.FLUTTER_CHANNEL }} | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Install Melos | |
run: dart pub global activate melos && melos bootstrap | |
- name: build_runner | |
run: | | |
echo '${{ secrets.ENV }}' | base64 -d > .env | |
melos generate | |
- name: format | |
run: melos run format | |
# 変更が発生した場合は プルリクエストを作成 | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
delete-branch: true | |
commit-message: "Auto format" | |
committer: "GitHub Actions <noreply@github.com>" | |
base: ${{ github.head_ref }} | |
branch: "auto-format/${{ github.sha }}" | |
title: "Auto format - ref: ${{ github.ref_name }}" | |
body: "Auto format by GitHub Actions on ${{ github.sha }}\nby: ${{github.actor}}" |