-
Notifications
You must be signed in to change notification settings - Fork 38
37 lines (34 loc) · 1.45 KB
/
save-pr-data-to-file.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
# SPDX-FileCopyrightText: 2023 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0
name: Prepare PR data
# Necessary step to allow adding external PRs to the project board
on: [pull_request, pull_request_target, pull_request_review]
jobs:
save-pr-data:
name: Save PR data to file
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login != 'github-actions[bot]' }}
steps:
- name: Save PR node_id and event_action to files
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
run: echo ${{ github.event.pull_request.node_id }} > PR_NODE_ID.txt && echo ${{ github.event.action }} > EVENT_ACTION.txt
- name: Archive PR node_id and event_action
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: actions/upload-artifact@v3
with:
name: PR_DATA
path: |
PR_NODE_ID.txt
EVENT_ACTION.txt
- name: Save PR node_id and review_state to files
if: github.event_name == 'pull_request_review'
run: echo ${{ github.event.pull_request.node_id }} > PR_NODE_ID.txt && echo ${{ github.event.review.state }} > REVIEW_STATE.txt
- name: Archive PR and review_state
if: github.event_name == 'pull_request_review'
uses: actions/upload-artifact@v3
with:
name: REVIEW_DATA
path: |
PR_NODE_ID.txt
REVIEW_STATE.txt