Skip to content

Commit

Permalink
Merge pull request #18 from nigeljamesstevenson/update/cherry-pick-on…
Browse files Browse the repository at this point in the history
…ly-works-on-trunk

log outputs for debugging
  • Loading branch information
nigeljamesstevenson authored May 9, 2024
2 parents 295919c + f7c9146 commit 81bbfe2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/cherry-pick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ jobs:
outputs:
run: ${{ steps.check.outputs.run }}
steps:
- name: Fetch Pull Request Details
if: github.event.issue.pull_request
id: fetch_pr_details
uses: actions/github-script@v6
with:
script: |
const issue = context.payload.issue;
const pullRequestUrl = issue.pull_request.url;
const prDetails = await github.request(pullRequestUrl);
console.log("PR Base Ref:", prDetails.data.base.ref);
core.setOutput('base_ref', prDetails.data.base.ref);
core.setOutput('head_ref', prDetails.data.head.ref);
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Use Pull Request Details
run: |
echo "Base branch of the PR is ${{ steps.fetch_pr_details.outputs.base_ref }}"
echo "Head branch of the PR is ${{ steps.fetch_pr_details.outputs.head_ref }}"
- name: check
id: check
uses: actions/github-script@v6
Expand Down

0 comments on commit 81bbfe2

Please sign in to comment.