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

Feature/#085 auto_merge_approved_pr.yml 오류 수정 #92

Merged
merged 3 commits into from
Nov 11, 2024
Merged
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
8 changes: 5 additions & 3 deletions .github/workflows/auto_merge_approved_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ jobs:
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});
return JSON.stringify(pr);
core.setOutput('result', JSON.stringify(pr));
- name: "Check Approvals"
id: check
uses: actions/github-script@v6
env:
PR_RESULT: ${{ steps.pr.outputs.result }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pr = JSON.parse(steps.pr.outputs.result);
const pr = JSON.parse(process.env.PR_RESULT);
const reviews = await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
Expand All @@ -36,7 +38,7 @@ jobs:
const approvals = reviews.data.filter(review => review.state === 'APPROVED');
core.setOutput('result', approvals.length >= 2);
- name: "Merge PR"
if: steps.check.outputs.result
if: ${{ steps.check.outputs.result == 'true' }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading