Skip to content

Commit

Permalink
Get event details
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Dec 6, 2023
1 parent 31d187c commit 722b598
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ jobs:
name: Dump GitHub Context.Event
runs-on: ubuntu-22.04
steps:
- name: Dump GitHub Context.Event
run: echo "${{ toJson(github.event) }}" | sed -r 's/#/\\#/g'
- name: Event details
run: |
echo "github.event_name: ${{ github.event_name }}"
echo "github.event.action: ${{ github.event.action }}"
# Test for PR, merge queue and merge to main
get-pr:
Expand Down
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ runs:
# Get PR number (different process for merge queue)
if [ ${{ github.event_name }} == 'pull_request' ]
then
echo "Event type: pull request"
pr=${{ github.event.number }}
else
elif [ ${{ github.event_name }} == 'merge_group' ]
pr=$(echo ${{ github.event.merge_group.head_ref }} | grep -Eo "queue/main/pr-[0-9]+" | cut -d '-' -f2)
echo "Event type: merge queue"
else
# pr=$(echo ${{ github.event.ref }} | grep -Eo "pr-[0-9]+" | cut -d '-' -f2)
echo "Event type: not pull request or merge queue"
fi
echo "Summary ---"
Expand Down

0 comments on commit 722b598

Please sign in to comment.