Skip to content

Commit aed690b

Browse files
committed
simpler script + fix branch deletion ?
1 parent ab2ef4e commit aed690b

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

.github/workflows/prepare_newsletter.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ jobs:
1818
run: |
1919
git config user.name github-actions
2020
git config user.email [email protected]
21-
git push -d origin _gh_action_ci_prepare_newletter
2221
git branch -D _gh_action_ci_prepare_newletter
2322
git branch -B _gh_action_ci_prepare_newletter
2423
git add .
2524
git commit -m "new newsletter"
26-
git push origin _gh_action_ci_prepare_newletter
25+
git push -f origin _gh_action_ci_prepare_newletter
2726
- name: create pull request
2827
run: gh pr create -B source -H _gh_action_ci_prepare_newletter --title 'Prepare new newsletter' --body 'Created by Github action'
2928
env:

scripts/prepare_newsletter.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,22 @@
77
set -v
88

99
read -r -d '\n' -a news <<< `find content/news/ -type d -printf "%f\n"| sort -n`
10-
echo $news
11-
echo ${news[-1]}
1210
13-
export last_news=`echo ${news[-1]} | sed -r s/0//`
14-
export news_to_create_simple=`echo $((last_news+1))`
15-
16-
echo $news_to_create_simple
17-
printf "%#03s" $news_to_create_simple
11+
last_news=`echo ${news[-1]} | sed -r s/0//`
12+
news_to_create_simple=`echo $((last_news+1))`
1813
1914
printf %03d $news_to_create_simple
2015
21-
export news_to_create=$(printf %03d $news_to_create_simple)
16+
news_to_create=$(printf %03d $news_to_create_simple)
17+
2218
echo $news_to_create
2319
read -e -p "Do you want to create issue $news_to_create? (y/n): " choice
2420
2521
[[ "$choice" != [Yy]* ]] && exit
2622
27-
echo "accepted"
23+
echo "accepted $news_to_create"
2824
29-
export new_file=`echo "content/news/$news_to_create/index.md"`
25+
new_file=`echo "content/news/$news_to_create/index.md"`
3026
3127
echo $new_file
3228

0 commit comments

Comments
 (0)