diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a64826b..17b2e7b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -65,3 +65,48 @@ jobs: registry_url: https://npm.pkg.github.com secrets: registry_token: ${{ secrets.GITHUB_TOKEN }} + pr-cli: + name: Open PR on seamapi/cli + runs-on: ubuntu-latest + timeout-minutes: 30 + needs: npm + steps: + - name: Checkout seamapi/cli + uses: actions/checkout@v7 + with: + repository: seamapi/cli + token: ${{ secrets.GH_TOKEN }} + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v7 + with: + git_user_signingkey: true + git_commit_gpgsign: true + git_committer_name: ${{ secrets.GIT_USER_NAME }} + git_committer_email: ${{ secrets.GIT_USER_EMAIL }} + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + - name: Setup Node.js + uses: actions/setup-node@v7 + with: + cache: npm + - name: Install dependencies + run: npm ci + - name: Update @seamapi/wizard + run: npm install --save-peer @seamapi/wizard@^${{ needs.npm.outputs.version }} + - name: Generate code + run: npm run generate + - name: Commit to seamapi/cli + id: commit + uses: stefanzweifel/git-auto-commit-action@v7 + with: + branch: seamapi/wizard/${{ needs.npm.outputs.version }} + create_branch: true + commit_message: 'feat: Update to @seamapi/wizard@${{ needs.npm.outputs.version }}' + commit_user_name: ${{ secrets.GIT_USER_NAME }} + commit_user_email: ${{ secrets.GIT_USER_EMAIL }} + commit_author: ${{ secrets.GIT_USER_NAME }} <${{ secrets.GIT_USER_EMAIL }}> + - name: Open pull request + if: steps.commit.outputs.changes_detected == 'true' + run: gh pr create --fill + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}