-
Notifications
You must be signed in to change notification settings - Fork 140
54 lines (47 loc) · 1.71 KB
/
prhandler.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
# This workflow will be triggered when a pull request is opened to the master
# branch. After being triggered, it will download the source from the branch
# to which the pull request was opened.
name: PR handler
on:
pull_request:
branches:
- master
jobs:
upload:
runs-on: ubuntu-20.04
name: Artifacts generation
steps:
# Download the source from the branch to which the pull request was
# opened.
- uses: actions/checkout@v3
with:
submodules: true
# Save the PR number for the next workflow to create the current
# workflow artifact along with the repository itself.
- name: Save PR number
run: echo ${{ github.event.number }} > ${{ github.workspace }}/NR
# Save the PR number for the next workflow to create the current
# workflow artifact along with the repository itself.
- name: Save target branch
run: echo ${{ github.base_ref }} > ${{ github.workspace }}/targetbranch
# Upload the artifacts to GitHub so that they can be used in the next
# workflow.
- name: Upload PR changes
uses: actions/upload-artifact@v3
with:
name: pr
path: |
${{ github.workspace }}
!${{ github.workspace }}/resources/ci_cd
!${{ github.workspace }}/.git
!${{ github.workspace }}/targetbranch
if-no-files-found: error
# Upload the artifacts to GitHub so that they can be used in the next
# workflow.
- name: Upload target branch name
uses: actions/upload-artifact@v3
with:
name: targetbranch
path: |
${{ github.workspace }}/targetbranch
if-no-files-found: error