-
Notifications
You must be signed in to change notification settings - Fork 7
68 lines (61 loc) · 1.97 KB
/
pullRequest.yml
File metadata and controls
68 lines (61 loc) · 1.97 KB
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
59
60
61
62
63
64
65
66
67
68
name: Pull Request
on:
pull_request:
paths:
- 'packs/**'
permissions:
contents: read
pull-requests: write
issues: write
jobs:
build:
name: Get changed packs
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: jitterbit/get-changed-files@v1
with:
format: json
- name: Unzip files from 'packs' directory
run: |
mkdir tmp
mkdir tmp/packs
# Get all zip files from of each pack and save the name of the pack in packs.md
echo '## Changed packs:' > packs.md
echo '' >> packs.md
echo '```' >> packs.md
echo '${{ steps.changed-files.outputs.added_modified }}' | jq -r '.[]' | grep 'packs/' | xargs -I {} unzip -o {} -d tmp/{}
find tmp/packs/ -name 'pack.meta' -exec cat {} \; >> packs.md
echo '' >> packs.md
echo '```' >> packs.md
echo '' >> packs.md
echo '## Changed files:' >> packs.md
echo '' >> packs.md
echo '```' >> packs.md
ls tmp/packs >> packs.md
echo '```' >> packs.md
echo '' >> packs.md
echo '## Contents of files:' >> packs.md
echo '' >> packs.md
echo '```' >> packs.md
ls -R tmp/packs/* | egrep -i ":|.zip|^$" >> packs.md
echo '```' >> packs.md
sed -i 's/tmp\/packs\///g' packs.md
- name: Log contents of markdown file
run: |
echo ${{ secrets.REPO_TOKEN }}
cat packs.md
- name: Create comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body-file: packs.md
reactions: eyes
edit-mode: replace
token: ${{ secrets.REPO_TOKEN }}