File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 echo "pr_number=$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
4040 echo "pr_owner=$(jq --raw-output .pull_request.user.login $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
4141 echo "pr_or_commit_description=$(jq --ascii-output .pull_request.body $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
42+ echo "post_merge_action=false" >> $GITHUB_ENV
43+
44+ # to get the PR data that can be used for post merge actions
45+ - uses : actions/github-script@v7
46+ if : github.event_name == 'push'
47+ id : get_pr_data
48+ with :
49+ github-token : ${{secrets.GITHUB_TOKEN}}
50+ script : |
51+ return (
52+ await github.rest.repos.listPullRequestsAssociatedWithCommit({
53+ commit_sha: context.sha,
54+ owner: context.repo.owner,
55+ repo: context.repo.repo,
56+ })
57+ ).data[0];
4258
4359 - name : Setup environment variables (Push)
4460 if : github.event_name == 'push'
5369 echo "pr_to_clone_url=$repo_url" >> $GITHUB_ENV
5470 echo "pr_title=Push trigger $branch_name $ref_id $repo_url" >> $GITHUB_ENV
5571 echo "pr_owner=$(jq --raw-output '.commits[0].author.username' $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
56- echo " pr_number=Null" >> $GITHUB_ENV
72+ echo ' pr_number=${{ fromJson(steps.get_pr_data.outputs.result).number }}' >> $GITHUB_ENV
5773 echo "pr_or_commit_description=$(jq --ascii-output .head_commit.message $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
74+ echo "post_merge_action=true" >> $GITHUB_ENV
5875
5976 - name : Checkout opensearch-build repo
6077 uses : actions/checkout@v4
You can’t perform that action at this time.
0 commit comments