Skip to content

Commit

Permalink
log
Browse files Browse the repository at this point in the history
  • Loading branch information
benpankow committed Jul 10, 2024
1 parent 804636c commit 50cf490
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions actions/hybrid_branch_deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,31 @@ runs:

- name: Get git sha
id: get_shas
run: git rev-list --ancestry-path cd2a864d09faa69900bff468f0f78d7e630ff87b..${{ github.event.pull_request.head.sha }}
run: echo "SHAS<<EOF\n$(git rev-list --ancestry-path cd2a864d09faa69900bff468f0f78d7e630ff87b..ff558eb2e32c7c24f54fb8cc699e05db8662d883)\nEOF" >> $GITHUB_OUTPUT
shell: bash

- uses: actions/github-script@v7
id: get_prs
env:
# Input the output of the previous step
PREVIOUS_SHA: ${{ steps.get_shas.outputs.stdout }}
PREVIOUS_SHAS: ${{ steps.get_shas.outputs.SHAS }}
with:
script: |
const previousShas = process.env.PREVIOUS_SHA.split('\n').map(s => s.trim()).filter(s => s.length > 0);
const previousShas = process.env.PREVIOUS_SHAS.split('\n').map(s => s.trim()).filter(s => s.length > 0);
console.log(previousShas);
let pullRequests = [];
for (const sha of previousShas) {
const pr = await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: sha,
owner: context.repo.owner,
repo: context.repo.repo,
});
console.log(pr);
if (pr.data.length > 0) {
pullRequests.push(...pr.data);
}
}
console.log(pullRequests);
return pullRequests;
- name: Print PRs
Expand Down

0 comments on commit 50cf490

Please sign in to comment.