fix: cc-resolve でフォークPRをスキップし、同一リポジトリPRのみ対応
This commit is contained in:
parent
e4af465d72
commit
2a8cc50ba0
13
.github/workflows/cc-resolve.yml
vendored
13
.github/workflows/cc-resolve.yml
vendored
@ -27,10 +27,19 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Get PR branch
|
||||
- name: Check if fork PR
|
||||
id: pr
|
||||
run: |
|
||||
echo "branch=$(gh pr view ${{ github.event.issue.number }} --repo ${{ github.repository }} --json headRefName -q .headRefName)" >> "$GITHUB_OUTPUT"
|
||||
PR_REPO=$(gh pr view ${{ github.event.issue.number }} --repo ${{ github.repository }} \
|
||||
--json headRepositoryOwner,headRepository \
|
||||
--jq '"\(.headRepositoryOwner.login)/\(.headRepository.name)"')
|
||||
BRANCH=$(gh pr view ${{ github.event.issue.number }} --repo ${{ github.repository }} \
|
||||
--json headRefName -q .headRefName)
|
||||
echo "branch=${BRANCH}" >> "$GITHUB_OUTPUT"
|
||||
if [ "$PR_REPO" != "${{ github.repository }}" ]; then
|
||||
echo "::error::Fork PR はサポートしていません。contributor 側で解決してください。"
|
||||
exit 1
|
||||
fi
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user