Skip to content

Commit

Permalink
test get prs
Browse files Browse the repository at this point in the history
  • Loading branch information
benpankow committed Jul 10, 2024
1 parent 301b494 commit 59178b5
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions actions/hybrid_branch_deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,34 @@ runs:
env:
DAGSTER_CLOUD_API_TOKEN: ${{ inputs.dagster_cloud_api_token }}

- name: Get git sha
id: get_shas
run: git rev-list --ancestry-path cd2a864d09faa69900bff468f0f78d7e630ff87b..${{ github.sha }}

- uses: actions/github-script@v7
id: get_prs
env:
# Input the output of the previous step
PREVIOUS_SHA: ${{ steps.get_shas.outputs.stdout }}
with:
script: |
const previousShas = process.env.PREVIOUS_SHA.split('\n').map(s => s.trim()).filter(s => s.length > 0);
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,
});
if (pr.data.length > 0) {
pullRequests.push(...pr.data);
}
}
reutrn pullRequests;
- name: Print PRs
run: echo "${{ steps.get_prs.outputs.result }}"

# Optional steps, leaves PR comment about build status
- name: Notify build success
uses: ./action-repo/actions/utils/notify
Expand Down

0 comments on commit 59178b5

Please sign in to comment.