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 {
2020}
2121
2222function 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 } ` ) ;
2424}
2525
2626const API_BASE = 'https://api.sendgrid.com/v3' ;
Original file line number Diff line number Diff line change 11#! /bin/bash
22
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 \
48 | grep ' ^_posts/' \
59 | head -n1) "
610
@@ -11,6 +15,8 @@ if [ -n "$post_path" ]; then
1115 fi
1216
1317 post_path=" $repo_root /$post_path "
18+
19+ echo Found post: $post_path
1420fi
1521
1622echo " ::set-output name=post_path::$post_path "
Original file line number Diff line number Diff line change 99 - run : ./.github/workflows/get_domain.sh
1010 shell : bash
1111 id : site-domain
12- - run : ./.github/workflows/find-modified-newsletter.sh
13- shell : bash
12+ - name : Find new post
1413 id : newsletter-path
15- - uses : ./.github/actions/render-newsletter
14+ run : ./.github/workflows/find-modified-newsletter.sh
15+ shell : bash
16+ - name : Render newsletter
1617 if : ${{ steps.newsletter-path.outputs.post_path != '' }}
1718 id : newsletter
19+ uses : ./.github/actions/render-newsletter
1820 with :
1921 text_path : " ${{ steps.newsletter-path.outputs.post_path }}"
2022 template_path : " ./.github/workflows/newsletter_template.html"
You can’t perform that action at this time.
0 commit comments