Skip to content

Commit 3b2c2d0

Browse files
committed
Use apify/actions/signed-commit, simplify logic
1 parent 5291c8b commit 3b2c2d0

3 files changed

Lines changed: 14 additions & 43 deletions

File tree

.github/workflows/manual_regenerate_models.yaml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,27 +104,18 @@ jobs:
104104
uv run poe generate-models
105105
fi
106106
107-
- name: Stage model changes
108-
id: stage
109-
run: |
110-
git add 'src/apify_client/_*_generated.py'
111-
if git diff --cached --quiet; then
112-
echo "has-changes=false" >> "$GITHUB_OUTPUT"
113-
else
114-
echo "has-changes=true" >> "$GITHUB_OUTPUT"
115-
fi
116-
117107
- name: Commit model changes
118-
if: steps.stage.outputs.has-changes == 'true'
119-
uses: apify/workflows/commit@v0.44.0
108+
id: commit
109+
uses: apify/actions/signed-commit@v1.0.0
120110
with:
121-
commit-message: ${{ env.TITLE }}
111+
message: ${{ env.TITLE }}
112+
add: 'src/apify_client/_*_generated.py'
122113
github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
123114
branch: ${{ env.BRANCH }}
124115
create-branch: 'true'
125116

126117
- name: Create or update PR
127-
if: steps.stage.outputs.has-changes == 'true'
118+
if: steps.commit.outputs.committed == 'true'
128119
id: pr
129120
env:
130121
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
@@ -158,7 +149,7 @@ jobs:
158149
159150
# Post a cross-repo comment on the original docs PR so reviewers know about the corresponding client-python PR.
160151
- name: Comment on apify-docs PR
161-
if: steps.stage.outputs.has-changes == 'true' && inputs.docs_pr_number
152+
if: steps.commit.outputs.committed == 'true' && inputs.docs_pr_number
162153
env:
163154
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
164155
PR_CREATED: ${{ steps.pr.outputs.created }}

.github/workflows/manual_release_docs.yaml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,12 @@ jobs:
5757
- name: Update docs theme
5858
run: uv run poe update-docs-theme
5959

60-
- name: Stage updated package.json and lockfile
61-
id: stage
62-
run: |
63-
git pull --rebase --autostash
64-
git add website/package.json website/pnpm-lock.yaml
65-
if git diff --cached --quiet; then
66-
echo "has-changes=false" >> "$GITHUB_OUTPUT"
67-
else
68-
echo "has-changes=true" >> "$GITHUB_OUTPUT"
69-
fi
70-
7160
- name: Commit the updated package.json and lockfile
72-
if: steps.stage.outputs.has-changes == 'true'
73-
uses: apify/workflows/commit@v0.44.0
61+
uses: apify/actions/signed-commit@v1.0.0
7462
with:
75-
commit-message: "chore: Automatic docs theme update [skip ci]"
63+
message: "chore: Automatic docs theme update [skip ci]"
64+
add: 'website/package.json website/pnpm-lock.yaml'
65+
pull: '--rebase --autostash'
7666
github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
7767

7868
- name: Build docs

.github/workflows/manual_version_docs.yaml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,10 @@ jobs:
9292
uv run pnpm exec docusaurus docs:version "$MAJOR_MINOR_VERSION"
9393
uv run pnpm exec docusaurus api:version "$MAJOR_MINOR_VERSION"
9494
95-
- name: Stage versioned docs
96-
id: stage
97-
run: |
98-
git pull --rebase --autostash
99-
git add website/versioned_docs website/versioned_sidebars website/versions.json
100-
if git diff --cached --quiet; then
101-
echo "has-changes=false" >> "$GITHUB_OUTPUT"
102-
else
103-
echo "has-changes=true" >> "$GITHUB_OUTPUT"
104-
fi
105-
10695
- name: Commit and push versioned docs
107-
if: steps.stage.outputs.has-changes == 'true'
108-
uses: apify/workflows/commit@v0.44.0
96+
uses: apify/actions/signed-commit@v1.0.0
10997
with:
110-
commit-message: "docs: Version docs for v${{ steps.snapshot.outputs.version }} [skip ci]"
98+
message: "docs: Version docs for v${{ steps.snapshot.outputs.version }} [skip ci]"
99+
add: 'website/versioned_docs website/versioned_sidebars website/versions.json'
100+
pull: '--rebase --autostash'
111101
github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)