Skip to content

Commit ad1896b

Browse files
ryanhymadelisma
authored andcommitted
chore: Update preview-html.yml
1 parent 2dbfe2f commit ad1896b

File tree

6 files changed

+860
-853
lines changed

6 files changed

+860
-853
lines changed

.github/workflows/parse-file-array.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# "${{ steps.printing.outputs.added_modified }}"
33
#!/bin/bash
44

5-
array=$added_modified
5+
array=$(cat ${HOME}/files.json)
6+
echo "$array"
67
array="${array//[}"
78
array="${array//]}"
89
array="${array//\"}"
@@ -12,9 +13,8 @@ for i in $(echo $array | sed "s/,/ /g")
1213
do
1314
if [ ${i: -4} = "html" ] || [ ${i: -3} = "htm" ]; then
1415
# call your procedure/other scripts here below
15-
output="${output}
16-
${url_preffix}${i}"
16+
output="${output}${url_preffix}${i}%0A"
1717
fi
1818
done
19-
echo $output
19+
echo "::set-env name=LINKS::$output"
2020

.github/workflows/preview-html.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
- feature/workflow
1111
paths:
1212
- '**.html'
13+
env:
14+
LINKS: nothing
1315
jobs:
1416
build:
1517
runs-on: ubuntu-latest
@@ -53,24 +55,28 @@ jobs:
5355
format: space-delimited
5456
- name: Printing
5557
run: |
56-
export msg=./.github/workflows/parse-file-array.sh
58+
./.github/workflows/parse-file-array.sh
5759
60+
#- name: Test
61+
# run: |
62+
# echo ${{ env.LINKS }}
63+
5864
# Create comment in the PR with the urls of the changed files
5965
- name: Comment in PR
6066
uses: unsplash/comment-on-pr@master
6167
env:
6268
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6369
with:
64-
msg: ${{ msg }}
65-
check_for_duplicate_msg: true # OPTIONAL
66-
# - name: Update status to pending
67-
# uses: geekodour/gh-actions-custom-status@v0.0.4
68-
# env:
69-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70-
# LAST_COMMIT_SHA: ${{ github.event.client_payload.LAST_COMMIT_SHA }}
71-
# with:
72-
# args: >-
73-
# --state=pending
74-
# --context=foo-status-update
75-
# --target_url=https://github.com/${{ github.repository }}/actions
76-
# Need to filter only HTML files too
70+
msg: ${{ env.LINKS }}
71+
check_for_duplicate_msg: false # OPTIONAL
72+
73+
- name: Update status to Waiting for approval
74+
uses: geekodour/gh-actions-custom-status@v0.0.4
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
LAST_COMMIT_SHA: ${{ github.event.client_payload.LAST_COMMIT_SHA }}
78+
with:
79+
args: >-
80+
--state=pending
81+
--context=preview-links
82+
--description=SHORT DESCRIPTION

.github/workflows/test.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
asdfasdfasdfasdfasdfasdf

index.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
34
<head>
4-
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Something in it!</title>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Something in it!</title>
78
</head>
9+
810
<body>
9-
<h1>Hello Work!</h1>
10-
<p>Where is the output file? I've found it!</p>
11-
<ul>
12-
<li>Test 1</li>
13-
<li>Let's try again</li>
14-
<li>Another trial</li>
15-
<li>Let's try this again</li>
16-
<li>and again</li>
17-
</ul>
11+
<h1>Hello Work!</h1>
12+
<p>Where is the output file? I've found it!</p>
13+
<ul>
14+
<li>Test 1</li>
15+
<li>Let's try again</li>
16+
<li>Another trial</li>
17+
<li>Let's try this again</li>
18+
<li>and agaiasdfn</li>
19+
</ul>
1820
</body>
21+
1922
</html>

0 commit comments

Comments
 (0)