Skip to content

Commit

Permalink
ci: remove unused PR data script
Browse files Browse the repository at this point in the history
  • Loading branch information
goaaats authored Jan 16, 2025
1 parent 2b5fd90 commit 4f30d63
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,6 @@ jobs:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Get Pull Request data
uses: actions/github-script@v7
id: get_pr_data
with:
script: |
const pr = (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0];
const reviews = (
await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr.number,
})
).data;

// Filter reviews for approved ones
const approvedReviews = reviews.filter(review => review.state === 'APPROVED');

if (approvedReviews.length === 0) {
throw new Error("Pull request has no approved reviews.");
}

// Setting the output explicitly
return {
number: pr.number,
title: pr.title,
first_approved_reviewer: approvedReviews[0].user.login
};
outputs: result

- name: Checkout manifests
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -99,7 +63,6 @@ jobs:
EXTENDED_IMAGE_LINK: ${{ secrets.EXTENDED_IMAGE_LINK }}
PLOGON_SECRETS_PK: ${{ secrets.PLOGON_SECRETS_PK }}
PLOGON_SECRETS_PK_PASSWORD: ${{ secrets.PLOGON_SECRETS_PK_PASSWORD }}
PLOGON_ACTOR: ${{ fromJson(steps.get_pr_data.outputs.result).first_approved_reviewer }}
XLWEB_KEY: ${{ secrets.XLWEB_KEY }}
PLOGON_S3_HISTORY_BUCKET: ${{ vars.PLOGON_S3_HISTORY_BUCKET }}
PLOGON_S3_DIFFS_BUCKET: ${{ vars.PLOGON_S3_DIFFS_BUCKET }}
Expand Down

0 comments on commit 4f30d63

Please sign in to comment.