-
Notifications
You must be signed in to change notification settings - Fork 375
58 lines (47 loc) · 1.5 KB
/
pull-request-target.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#
# Workflow: Build PR
#
name: Build PR (Organization)
on: pull_request_target
jobs:
build-pr:
name: "Build PR (Organization) #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}"
runs-on: ubuntu-latest
outputs:
ref: ${{ steps.get-refs.ref }}
steps:
- name: Step
shell: bash
run: |
echo "PR #${{ github.event.pull_request.number }}"
if [ -z "${{ secrets.SOME_SECRET_TOKEN }}" ]; then
echo "SECRET IS ABSENT"
else
echo "SECRET IS PRESENT"
fi
echo "login = ${{ github.event.pull_request.head.repo.owner.login }}"
echo "login = ${{ github.event.pull_request_target.head.repo.owner.login }}"
echo "${{ secrets }}"
- name: Get Refs
id: get-refs
shell: bash
run: |
echo "ref=refs/pull/${{ github.event.pull_request.number }}/merge" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
token: ${{ secrets.GITHUB_TOKEN }}
- name: Report
shell: bash
run: |
git log --graph --pretty=format':%h%d %s %an, %ar' | head -n 12
build-pr-call:
name: "Call (Organization)"
needs: build-pr
uses: ./.github/workflows/callme.yml
secrets: {}
permissions: {}
with:
something: false
ref: ${{ needs.build-pr.ref }}