Skip to content

Update Samples in Kalix.io Repo #3

Update Samples in Kalix.io Repo

Update Samples in Kalix.io Repo #3

name: Update Samples in Kalix.io Repo
on:
workflow_dispatch: # Manually triggered workflow
jobs:
open-pr-update-sample:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- { sample: java-spring-choreography-saga-quickstart, public-repo: user-registry-choreography-saga }
steps:
- name: Checkout JVM SDK
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
path: kalix-jvm-sdk
sparse-checkout: |
samples/${{ matrix.sample }}
- name: Fork the repo
run: |
echo "n" | gh repo fork kalix-io/${{ matrix.public-repo }} --remote --default-branch-only
env:
GITHUB_TOKEN: ${{ secrets.KALIX_BOT_ACCESS_TOKEN }}
- name: Checkout sample in kalix.io
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
repository: kalix-io/${{ matrix.public-repo }}
path: ${{ matrix.public-repo }}/
- name: Copy example
run: |
rsync -r --delete kalix-jvm-sdk/samples/${{ matrix.sample }}/* ${{ matrix.public-repo }}
- name: Explicitly add the .env file
run: |
git config user.name 'Kalix Bot'
git config user.email '[email protected]'
git add .env
git commit -m "Keep .env"
- name: Create Pull Request - ${{ matrix.public-repo }}
# https://github.com/peter-evans/create-pull-request
# v6.0.5
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e
with:
path: ${{ matrix.public-repo }}
title: Changes from JVM SDK repo
branch-suffix: short-commit-hash
body: Please review
push-to-fork: kalix-bot/${{ matrix.public-repo }}
delete-branch: true
commit-message: "Changes from the Kalix JVM SDK repo"
author: "Kalix Bot <[email protected]>"
committer: "Kalix Bot <[email protected]>"
token: ${{ secrets.KALIX_BOT_ACCESS_TOKEN }}