Skip to content

Update dev-hato/actions-diff-pr-management action to v1.2.1 #8224

Update dev-hato/actions-diff-pr-management action to v1.2.1

Update dev-hato/actions-diff-pr-management action to v1.2.1 #8224

Workflow file for this run

---
name: pr-format
# pull_requestで何かあった時に起動する
on:
pull_request:
types:
- opened
- synchronize
- reopened
- closed
push:
branches:
- master
permissions:
contents: write
pull-requests: write
jobs:
# PRが来たらformatをかけてみて、差分があればPRを作って、エラーで落ちるjob
pr-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
# ここでsubmodule持ってくるとdetached headにcommitして死ぬ
# submodule: 'recursive'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
id: setup_python
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
python-version-file: .python-version
cache: pipenv
- if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: sed -i -e "s/python_version = \".*\"/python_version = \"$(echo ${{ steps.setup_python.outputs.python-version }} | sed -e 's/\([0-9]*\.[0-9]*\).*/\1/g')\"/g" Pipfile
- name: Install dependencies
if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: bash "${GITHUB_WORKSPACE}/scripts/pipenv_install.sh"
# formatする
# --exit-codeをつけることで、autopep8内でエラーが起きれば1、差分があれば2のエラーステータスコードが返ってくる。正常時は0が返る
- name: Format files
id: format
if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: bash "${GITHUB_WORKSPACE}/scripts/pr_format/pr_format/format.sh"
- uses: dev-hato/actions-diff-pr-management@8d475e5bc78f61c40024d4859b79134b66f788d2 # v1.2.1
if: success() || failure()
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