Skip to content

Commit

Permalink
Выносит часть скрипта в экшен
Browse files Browse the repository at this point in the history
  • Loading branch information
igsekor committed Jul 16, 2024
1 parent e7a0505 commit 3fc45d9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
17 changes: 0 additions & 17 deletions .github/scripts/update-changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,3 @@ RUS_MONTH=$(MONTH_TO_RUS $MONTH)
FORMATTED_DATE="$DAY $RUS_MONTH"

node .github/scripts/update-changelog.js "$FORMATTED_DATE"


if [[ -z $(git status -s) ]]
then
echo $(git status)
else
git config user.name "Doka Dog"
git config user.email "<[email protected]>"

git add CHANGELOG.md
git commit -m "Обновляет CHANGELOG" --author "Doka Dog <[email protected]>"

git pull --rebase
git push origin main

exit
fi
27 changes: 20 additions & 7 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,28 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.DOKA_BOT_ACCESS_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
- uses: actions/setup-node@v3
with:
node-version: '20'

node-version: "20"
- name: Ищет новые материалы и обновляет CHANGELOG
run: sh .github/scripts/update-changelog.sh
- name: Создание коммита с обновлениями полей
run: |
if [[ -z $(git status -s) ]]
then
echo $(git status)
else
git config user.name "Doka Dog"
git config user.email "<[email protected]>"
git add CHANGELOG.md
git commit -m "Обновляет CHANGELOG" --author "Doka Dog <[email protected]>"
git pull --rebase
git push origin main
exit
fi

0 comments on commit 3fc45d9

Please sign in to comment.