diff --git a/.github/workflows/auto-author-assign.yml b/.github/workflows/auto-author-assign.yml index 804d047..f6d7654 100644 --- a/.github/workflows/auto-author-assign.yml +++ b/.github/workflows/auto-author-assign.yml @@ -1,17 +1,17 @@ -# name: Auto Author Assign -# -# on: -# pull_request_target: -# types: -# - opened -# - reopened -# -# permissions: -# pull-requests: write -# -# jobs: -# assign-author: -# name: Assign PR author as assignee -# runs-on: ubuntu-slim -# steps: -# - uses: toshimaru/auto-author-assign@v3.0.1 +name: Auto Author Assign + +on: + pull_request_target: + types: + - opened + - reopened + +permissions: + pull-requests: write + +jobs: + assign-author: + name: Assign PR author as assignee + runs-on: ubuntu-slim + steps: + - uses: toshimaru/auto-author-assign@v3.0.1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 4927616..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: CI - -on: - pull_request_target: - types: - - opened - - reopened - - edited - - synchronize - -permissions: - statuses: write - pull-requests: write - -jobs: - assign-author: - name: Assign PR author as assignee - if: github.event.action == 'opened' || github.event.action == 'reopened' - runs-on: ubuntu-slim - steps: - - uses: toshimaru/auto-author-assign@v3.0.1 - - lint: - name: Validate PR title - runs-on: ubuntu-slim - steps: - - name: Lint PR title - id: lint_pr_title - uses: amannn/action-semantic-pull-request@v6 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - with: - disallowScopes: | - .*[A-Z].* - subjectPattern: ^(?![A-Z]).+$ - subjectPatternError: | - Pull Request のタイトル "{title}" に含まれる subject "{subject}" がルールに一致しませんでした。 - subject は大文字で始まらないようにしてください。 - # 主にプライベートリポジトリ向けの `[WIP]` 接頭辞対応 - # これを有効にする場合、statuses: write 権限が必要 - wip: true - - - name: Comment on failure - if: always() && (steps.lint_pr_title.outputs.error_message != null) - uses: marocchino/sticky-pull-request-comment@v2 - with: - header: semantic-pr-title - message: | - Pull Request のタイトルは [Conventional Commits](https://www.conventionalcommits.org/ja/) に従う必要があります。 - 提案されたタイトルは調整が必要なようです。 - - 以下のフォーマットに従ってください。 - - ``` - feat(api): add user endpoint - ^ ^ ^ - │ │ └── subject - │ └──────── scope(任意) - └───────────── type - ``` - - > [!NOTE] - > 先頭に変更の種類 `type` を付け、その後に短く変更の内容 `subject` を書きます。 - > `scope` は任意ですが、書く場合は `(scope)` を `type` の後に付けてください。 - > なお、`scope` に大文字を使用することはできず、`subject` を大文字で始めることはできません。 - - > [!NOTE] - > Revert PR の場合、タイトルは `revert: ` の形式にする必要があります。 - - > [!TIP] - > ドラフト(Work in Progress)PR の場合、タイトルの先頭に `[WIP]` を付けることができます。 - > なお、マージの際にはこの `[WIP]` を削除してください。 - - 詳細(エラー): - ``` - ${{ steps.lint_pr_title.outputs.error_message }} - ``` - - - name: Clear comment on success - if: always() && (steps.lint_pr_title.outputs.error_message == null) - uses: marocchino/sticky-pull-request-comment@v2 - with: - header: semantic-pr-title - delete: true diff --git a/.github/workflows/semantic-pr-title.yml b/.github/workflows/semantic-pr-title.yml index 1761f97..e2a3e20 100644 --- a/.github/workflows/semantic-pr-title.yml +++ b/.github/workflows/semantic-pr-title.yml @@ -1,78 +1,78 @@ -# name: Semantic PR Title -# -# on: -# pull_request_target: -# types: -# - opened -# - reopened -# - edited -# - synchronize -# -# permissions: -# statuses: write -# pull-requests: write -# -# jobs: -# lint: -# name: Validate PR title -# runs-on: ubuntu-slim -# steps: -# - name: Lint PR title -# id: lint_pr_title -# uses: amannn/action-semantic-pull-request@v6 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# -# with: -# disallowScopes: | -# .*[A-Z].* -# subjectPattern: ^(?![A-Z]).+$ -# subjectPatternError: | -# Pull Request のタイトル "{title}" に含まれる subject "{subject}" がルールに一致しませんでした。 -# subject は大文字で始まらないようにしてください。 -# # 主にプライベートリポジトリ向けの `[WIP]` 接頭辞対応 -# # これを有効にする場合、statuses: write 権限が必要 -# wip: true -# -# - name: Comment on failure -# if: always() && (steps.lint_pr_title.outputs.error_message != null) -# uses: marocchino/sticky-pull-request-comment@v2 -# with: -# header: semantic-pr-title -# message: | -# Pull Request のタイトルは [Conventional Commits](https://www.conventionalcommits.org/ja/) に従う必要があります。 -# 提案されたタイトルは調整が必要なようです。 -# -# 以下のフォーマットに従ってください。 -# -# ``` -# feat(api): add user endpoint -# ^ ^ ^ -# │ │ └── subject -# │ └──────── scope(任意) -# └───────────── type -# ``` -# -# > [!NOTE] -# > 先頭に変更の種類 `type` を付け、その後に短く変更の内容 `subject` を書きます。 -# > `scope` は任意ですが、書く場合は `(scope)` を `type` の後に付けてください。 -# > なお、`scope` に大文字を使用することはできず、`subject` を大文字で始めることはできません。 -# -# > [!NOTE] -# > Revert PR の場合、タイトルは `revert: ` の形式にする必要があります。 -# -# > [!TIP] -# > ドラフト(Work in Progress)PR の場合、タイトルの先頭に `[WIP]` を付けることができます。 -# > なお、マージの際にはこの `[WIP]` を削除してください。 -# -# 詳細(エラー): -# ``` -# ${{ steps.lint_pr_title.outputs.error_message }} -# ``` -# -# - name: Clear comment on success -# if: always() && (steps.lint_pr_title.outputs.error_message == null) -# uses: marocchino/sticky-pull-request-comment@v2 -# with: -# header: semantic-pr-title -# delete: true +name: Semantic PR Title + +on: + pull_request_target: + types: + - opened + - reopened + - edited + - synchronize + +permissions: + statuses: write + pull-requests: write + +jobs: + lint: + name: Validate PR title + runs-on: ubuntu-slim + steps: + - name: Lint PR title + id: lint_pr_title + uses: amannn/action-semantic-pull-request@v6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + with: + disallowScopes: | + .*[A-Z].* + subjectPattern: ^(?![A-Z]).+$ + subjectPatternError: | + Pull Request のタイトル "{title}" に含まれる subject "{subject}" がルールに一致しませんでした。 + subject は大文字で始まらないようにしてください。 + # 主にプライベートリポジトリ向けの `[WIP]` 接頭辞対応 + # これを有効にする場合、statuses: write 権限が必要 + wip: true + + - name: Comment on failure + if: always() && (steps.lint_pr_title.outputs.error_message != null) + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: semantic-pr-title + message: | + Pull Request のタイトルは [Conventional Commits](https://www.conventionalcommits.org/ja/) に従う必要があります。 + 提案されたタイトルは調整が必要なようです。 + + 以下のフォーマットに従ってください。 + + ``` + feat(api): add user endpoint + ^ ^ ^ + │ │ └── subject + │ └──────── scope(任意) + └───────────── type + ``` + + > [!NOTE] + > 先頭に変更の種類 `type` を付け、その後に短く変更の内容 `subject` を書きます。 + > `scope` は任意ですが、書く場合は `(scope)` を `type` の後に付けてください。 + > なお、`scope` に大文字を使用することはできず、`subject` を大文字で始めることはできません。 + + > [!NOTE] + > Revert PR の場合、タイトルは `revert: ` の形式にする必要があります。 + + > [!TIP] + > ドラフト(Work in Progress)PR の場合、タイトルの先頭に `[WIP]` を付けることができます。 + > なお、マージの際にはこの `[WIP]` を削除してください。 + + 詳細(エラー): + ``` + ${{ steps.lint_pr_title.outputs.error_message }} + ``` + + - name: Clear comment on success + if: always() && (steps.lint_pr_title.outputs.error_message == null) + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: semantic-pr-title + delete: true