Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

format

format #1085

Workflow file for this run

---
name: format
on:
pull_request:
types:
- opened
- synchronize
- reopened
- closed
push:
branches:
- main
merge_group:
permissions:
contents: write
pull-requests: write
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- uses: actions/checkout@v4.1.7
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
repository: misskey-dev/misskey
ref: master
path: misskey
- uses: actions/setup-go@v5.0.2
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
go-version-file: go.mod
- uses: actions/setup-node@v4.0.3
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
cache: npm
- if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: |
go install golang.org/x/tools/cmd/goimports
go generate ./ent
go mod tidy
goimports -l -w .
- if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: npm install
- name: Get Misskey's Postgres version
id: get_misskey_postgres_version
if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: |
cp .config/docker_example.env .config/docker.env
cp ./docker-compose_example.yml ./docker-compose.yml
echo "version=$(docker compose run --rm db pg_config --version | awk '{print $NF}')" >> "$GITHUB_OUTPUT"
working-directory: misskey
- if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: sed -i -e 's/FROM postgres:.*/FROM postgres:${{ steps.get_misskey_postgres_version.outputs.version }}/g' db/Dockerfile
- uses: dev-hato/actions-diff-pr-management@v1.1.12
with:
github-token: ${{secrets.GITHUB_TOKEN}}
branch-name-prefix: fix-format
pr-title-prefix: formatが間違ってたので直してあげたよ!
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true