-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: github-actions <[email protected]> Co-authored-by: Naka Masato <[email protected]>
- Loading branch information
1 parent
e08914a
commit 3bbf0e8
Showing
2 changed files
with
11 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,9 +29,9 @@ jobs: | |
id: need_commit | ||
run: | | ||
if [[ -n "$(git status --porcelain)" ]]; then | ||
echo "::set-output name=need_commit::true | ||
echo "need_commit=true" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "::set-output name=need_commit::false | ||
echo "need_commit=false" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: commit and push | ||
|
@@ -50,7 +50,7 @@ jobs: | |
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # used by gh | ||
run: | | ||
echo "::set-output name=count::$(gh pr list -S head:${{ env.BRANCH_NAME }} -B ${{ env.BASE_BRANCH_NAME }} | wc -l)" | ||
echo "count=$(gh pr list -S head:${{ env.BRANCH_NAME }} -B ${{ env.BASE_BRANCH_NAME }} | wc -l)" >> "$GITHUB_OUTPUT" | ||
- name: create pr | ||
if: ${{ steps.need_commit.outputs.need_commit == 'true' && steps.check_pr.outputs.count == 0 }} | ||
|
@@ -73,14 +73,17 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: get pull request number | ||
id: get_pr_number | ||
run: | | ||
echo ${{ fromJson(steps.create_pr.outputs.data).number }} | ||
if [[ ${{ steps.check_pr.outputs.count }} = 0 ]]; then | ||
echo "pr_number=${{ fromJson(steps.create_pr.outputs.data).number }}" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: request reviwer | ||
if: ${{ steps.need_commit.outputs.need_commit == 'true' && steps.check_pr.outputs.count == 0 }} | ||
if: steps.get_pr_number.outputs.pr_number != "" | ||
uses: octokit/[email protected] | ||
with: | ||
route: POST /repos/${{ github.repository }}/pulls/${{ fromJson(steps.create_pr.outputs.data).number }}/requested_reviewers | ||
reviewers: "[\"nakamasato\"]" | ||
route: POST /repos/${{ github.repository }}/pulls/${{ steps.get_pr_number.outputs.pr_number }}/requested_reviewers | ||
reviewers: "[\"${{ github.actor }}\"]" # the person who merges the pr | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters