fix: use README template with sed
This commit is contained in:
@@ -14,12 +14,20 @@ jobs:
|
||||
git clone http://gitea-http:3000/${{ github.repository }}.git .
|
||||
git checkout ${{ github.ref_name }}
|
||||
|
||||
|
||||
- name: Update README
|
||||
run: |
|
||||
LOC=$(grep '"total_code"' public/code-stats.json | sed 's/[^0-9]*//g')
|
||||
export FORMATTED_LOC=$(printf "%'d" $LOC)
|
||||
FORMATTED_LOC=$(printf "%'d" $LOC)
|
||||
|
||||
envsubst < README.template > README.md
|
||||
echo "Injecting $FORMATTED_LOC into README.template..."
|
||||
|
||||
sed "s/REPLACE_ME_LOC/$FORMATTED_LOC/g" README.template > README.md
|
||||
|
||||
if [ ! -s README.md ]; then
|
||||
echo "Error: README.md is empty!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Commit and Push
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user