Skip to content

Commit 00b0395

Browse files
committed
fix(ci): replace peter-evans/create-pull-request with gh pr create
1 parent 58595c1 commit 00b0395

1 file changed

Lines changed: 17 additions & 25 deletions

File tree

.github/workflows/cli-docs.yml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -95,35 +95,27 @@ jobs:
9595
rsync -a --delete "${{ github.workspace }}/docs/api-references/" docs-repo/pages/api-references/genlayer-cli/
9696
echo "Synced files:" && ls -la docs-repo/pages/api-references/genlayer-cli | cat
9797
98-
- name: Commit changes
98+
- name: Commit, push, and create PR
9999
working-directory: docs-repo
100+
env:
101+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
100102
run: |
101103
set -euo pipefail
102-
if [ -n "$(git status --porcelain)" ]; then
103-
git add pages/api-references/genlayer-cli
104-
git commit -m "docs(cli): sync API reference ${VERSION:-${{ env.VERSION }}}"
105-
git push --set-upstream origin "$BRANCH"
106-
echo "HAS_CHANGES=true" >> $GITHUB_ENV
107-
else
104+
if [ -z "$(git status --porcelain)" ]; then
108105
echo "No changes to commit"
109-
echo "HAS_CHANGES=false" >> $GITHUB_ENV
106+
exit 0
110107
fi
111-
112-
- name: Create PR in docs repo
113-
if: env.HAS_CHANGES == 'true'
114-
uses: peter-evans/create-pull-request@v6
115-
with:
116-
token: ${{ steps.app-token.outputs.token }}
117-
path: docs-repo
118-
commit-message: "docs(cli): sync API reference ${{ steps.version.outputs.value }}"
119-
branch: ${{ env.BRANCH }}
120-
title: "docs(cli): sync CLI API reference ${{ steps.version.outputs.value }}"
121-
body: |
122-
This PR updates the GenlayerCLI API Reference generated automatically from `${{ github.repository }}`.
123-
124-
- Version: `${{ steps.version.outputs.value }}`
125-
- Source commit: `${{ github.sha }}`
126-
- Trigger: `${{ github.event_name }}`
127-
labels: documentation, cli
108+
git add pages/api-references/genlayer-cli
109+
git commit -m "docs(cli): sync API reference ${{ steps.version.outputs.value }}"
110+
git push --set-upstream origin "$BRANCH"
111+
gh pr create \
112+
--repo genlayerlabs/genlayer-docs \
113+
--base main \
114+
--head "$BRANCH" \
115+
--title "docs(cli): sync CLI API reference ${{ steps.version.outputs.value }}" \
116+
--body "Auto-generated API reference update from genlayer-cli.
117+
118+
- Version: \`${{ steps.version.outputs.value }}\`
119+
- Source commit: \`${{ github.sha }}\`"
128120
129121

0 commit comments

Comments
 (0)