Skip to content

Minor change: timestamp is now an iso8601 #19

Minor change: timestamp is now an iso8601

Minor change: timestamp is now an iso8601 #19

name: auto-commit-build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Build dist
run: |
yarn
yarn test
if [ $? == 0 ]; then
echo "Yarn test passed";
echo "Building package.."
yarn build
if [ $? != 0 ]; then
echo "Yarn build failed"
echo "Aborting"
exit 1
fi
echo "Setting github action committer"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
echo "Adding dist"
git add -f dist/dexcom-share-api.es.js dist/dexcom-share-api.umd.js
changed_count=$(git status | grep "modified:" | wc -l)
if [ "$changed_count" -ge 1 ]; then
echo "Committing.."
git commit -m "<auto-committer> Update dist"
echo "Pushing.."
git push -f origin HEAD:main
else
echo "Skipping push, no files changed"
fi
else
echo "Yarn test failed"
echo "Aborting"
exit 1
fi