-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (44 loc) · 1.65 KB
/
pr-issue-validator-new.yaml
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
name: Validate Pull Request
on:
pull_request:
types:
- opened
- synchronize
- edited
- reopened
branches:
- 'main'
- 'release-**'
- 'master'
jobs:
validate-PR-issue:
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
pull-requests: write
steps:
- name: Find linked issues
id: find-linked-issues
uses: Ismoh-Games/find-linked-issues@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
pull-request-number: ${{ github.event.pull_request.number }}
pull-request-body: ${{ github.event.pull_request.body }}
copy-issues-labels: true # optional
include-closed-issues: true # optional
# Use the output from the `find-linked-issues` step
- name: Use the output
run: |
echo "is-pull-request-linked-to-issues: ${{ steps.find-linked-issues.outputs.is-pull-request-linked-to-issues }}"
echo "linked-issues: ${{ steps.find-linked-issues.outputs.linked-issues }}"
echo "pull-request-labels: ${{ steps.find-linked-issues.outputs.pull-request-labels }}"
- name: Conditional step
if: ${{ steps.find-linked-issues.outputs.is-pull-request-linked-to-issues == 'True' }}
run: |
echo "Pull request is linked to issues"
- name: Another conditional step
if: ${{ steps.find-linked-issues.outputs.is-pull-request-linked-to-issues == 'False' }}
run: |
exit 1