Bump @usecapsule/react-sdk #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bump @usecapsule/react-sdk | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
bump: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install npm-check-updates | |
run: npm install -g npm-check-updates | |
- name: Bump dependency | |
run: | | |
while IFS= read -r file; do | |
ncu "@usecapsule/react-sdk" -u -f "@usecapsule/react-sdk" --packageFile "$file" | |
done < <(find . -name "package.json") | |
if [ -z "$(git status --porcelain)" ]; then | |
exit 0 | |
fi | |
- name: Install and Build | |
run: | | |
for DIR in $(find . -name package.json -exec dirname {} \; | sort -u); do | |
cd "$DIR" | |
if [ -f package.json ]; then | |
npm ci || exit 1 | |
if grep -q "\"build\":" package.json; then | |
npm run build || exit 1 | |
fi | |
fi | |
cd - >/dev/null | |
done | |
- name: Commit changes | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git checkout -b chore/bump-react-sdk | |
git add . | |
git commit -m "chore: bump @usecapsule/react-sdk" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
branch: chore/bump-react-sdk | |
commit-message: "chore: bump @usecapsule/react-sdk" | |
title: "chore: Bump @usecapsule/react-sdk" | |
body: "Auto-generated bump for @usecapsule/react-sdk." | |
base: main | |
labels: dependencies | |
auto-merge: true | |
merge-method: squash |