File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
actions/render-newsletter/src Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ function escapeData(s: string): string {
20
20
}
21
21
22
22
function setOutput ( key : string , val : string ) {
23
- process . stdout . write ( `::set-output name=${ key } ::${ escapeData ( val ) } ` + EOL ) ;
23
+ process . stdout . write ( `::set-output name=${ key } ::${ escapeData ( val ) } ${ EOL } ` ) ;
24
24
}
25
25
26
26
const API_BASE = 'https://api.sendgrid.com/v3' ;
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- post_path=" $( git log --pretty=format: --name-only -1 --diff-filter=A \
3
+ # Find the latest commit that doesn't change the actions or workflows
4
+ commit_hash=$( git log --pretty=format:%H -1 -- ' :/!.github/*' )
5
+
6
+ # Find new posts in the latest commit, if any
7
+ post_path=" $( git show --pretty=format: --name-only --diff-filter=A $commit_hash \
4
8
| grep ' ^_posts/' \
5
9
| head -n1) "
6
10
@@ -11,6 +15,8 @@ if [ -n "$post_path" ]; then
11
15
fi
12
16
13
17
post_path=" $repo_root /$post_path "
18
+
19
+ echo Found post: $post_path
14
20
fi
15
21
16
22
echo " ::set-output name=post_path::$post_path "
Original file line number Diff line number Diff line change 9
9
- run : ./.github/workflows/get_domain.sh
10
10
shell : bash
11
11
id : site-domain
12
- - run : ./.github/workflows/find-modified-newsletter.sh
13
- shell : bash
12
+ - name : Find new post
14
13
id : newsletter-path
15
- - uses : ./.github/actions/render-newsletter
14
+ run : ./.github/workflows/find-modified-newsletter.sh
15
+ shell : bash
16
+ - name : Render newsletter
16
17
if : ${{ steps.newsletter-path.outputs.post_path != '' }}
17
18
id : newsletter
19
+ uses : ./.github/actions/render-newsletter
18
20
with :
19
21
text_path : " ${{ steps.newsletter-path.outputs.post_path }}"
20
22
template_path : " ./.github/workflows/newsletter_template.html"
You can’t perform that action at this time.
0 commit comments