Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

リリースノート修正 #104

Merged
merged 5 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ template: |
autolabeler:
- label: feature
branch:
- '/^feat(ure)?[/-].+/'
- '/feat(ure)?[/-].+/'
- label: bug
branch:
- '/^fix[/-].+/'
- '/fix[/-].+/'
- label: chore
branch:
- '/^chore[/-].+/'
- '/chore[/-].+/'
- label: refactor
branch:
- '/(refactor|refactoring)[/-].+/'
- '/refactor[/-].+/'
- label: documentation
branch:
- '/doc[/-].+/'
- label: enhancement
branch:
- '/(enhancement|improve)[/-].+/'
- '/enhancement[/-].+/'
- label: dependencies
branch:
- '/^dep(s)?[/-].+/'
- '/^dependency[/-].+/'
- '/dep(s)?[/-].+/'
- '/dependency[/-].+/'
20 changes: 14 additions & 6 deletions .github/workflows/link-pr-to-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ on:
pull_request:
types: [opened]
workflow_dispatch:
inputs:
pr_number:
description: 'Pull Request number'
required: true
inputs:
pr_number:
description: "Pull Request number"
required: true

jobs:
link_pr_to_issue:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract issue number from branch name
id: extract-issue
env:
Expand All @@ -22,8 +28,10 @@ jobs:
PR_NUMBER="${{ github.event.inputs.pr_number }}"
BRANCH_NAME=$(gh pr view $PR_NUMBER --json headRefName -q .headRefName)
else
PR_NUMBER="${{ github.event.pull_request.number }}"
BRANCH_NAME="${{ github.head_ref }}"
ttizze marked this conversation as resolved.
Show resolved Hide resolved
fi
Comment on lines +31 to 33

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The indentation of the PR_NUMBER and BRANCH_NAME assignments is inconsistent. It should be aligned with the surrounding code.

-             PR_NUMBER="${{ github.event.pull_request.number }}"
-              BRANCH_NAME="${{ github.head_ref }}"
+            PR_NUMBER="${{ github.event.pull_request.number }}"
+            BRANCH_NAME="${{ github.head_ref }}"

echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
ISSUE_NUMBER=$(echo $BRANCH_NAME | grep -oP 'issue-\K\d+' || true)
if [ -z "$ISSUE_NUMBER" ]; then
echo "No issue number found in branch name. Workflow will exit."
Expand All @@ -35,10 +43,10 @@ jobs:
if: steps.extract-issue.outputs.issue_number
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_NUMBER: ${{ steps.extract-issue.outputs.pr_number }}
ISSUE_NUMBER: ${{ steps.extract-issue.outputs.issue_number }}
ttizze marked this conversation as resolved.
Show resolved Hide resolved
run: |
gh pr edit $PR_NUMBER --add-label "linked-to-issue"
gh pr comment $PR_NUMBER --body "This PR is linked to issue #$ISSUE_NUMBER"
gh issue edit $ISSUE_NUMBER --add-project "Project Board Name"
gh issue comment $ISSUE_NUMBER --body "PR #$PR_NUMBER has been linked to this issue"
gh issue comment $ISSUE_NUMBER --body "PR #$PR_NUMBER has been linked to this issue"
Loading