Skip to content

Commit abd8657

Browse files
committed
fix cp? + create branch and commit
1 parent 3b49a9a commit abd8657

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.github/workflows/prepare_newsletter.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@ jobs:
1414
run: echo y | ./scripts/prepare_newsletter.sh
1515
env:
1616
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
- name: create branch and commit
18+
run: |
19+
git config user.name github-actions
20+
git config user.email [email protected]
21+
git push -d origin _gh_action_ci_prepare_newletter
22+
git branch -D _gh_action_ci_prepare_newletter
23+
git branch -B _gh_action_ci_prepare_newletter
24+
git add .
25+
git commit -m "new newsletter"
26+
git push origin _gh_action_ci_prepare_newletter
1727
- name: create pull request
18-
run: gh pr create -B source -H new_newsletter --title 'Prepare new newsletter' --body 'Created by Github action'
28+
run: gh pr create -B source -H _gh_action_ci_prepare_newletter --title 'Prepare new newsletter' --body 'Created by Github action'
1929
env:
2030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

scripts/prepare_newsletter.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
# alongside the others, with its incremented id number.
55
# This script also replaces the TODOs related to the news id number.
66

7-
ls -l content/news
8-
9-
find content/news/ -type d -printf "%f\n" | sort -n
7+
set -v
108

119
read -r -d '\n' -a news <<< `find content/news/ -type d -printf "%f\n"| sort -n`
1210
@@ -23,6 +21,8 @@ echo "accepted"
2321
2422
new_file="content/news/$news_to_create/index.md"
2523
26-
mkdir -p content/news/$news_to_create && cp -r newsletter-template.md $new_file
24+
echo $new_file
25+
26+
mkdir -p content/news/$news_to_create && cp newsletter-template.md $new_file
2727
2828
sed -i 's/{TODO_id}/'$news_to_create_simple'/g' $new_file

0 commit comments

Comments
 (0)