1 name: Update CLI
2
3 on:
4 workflow_dispatch:
5 schedule:
6 - cron: "14 2 * * *"
7
8 jobs:
9 update-cli:
10 outputs:
11 has_changes: $\{{ steps.status.outputs.has_changes }}
12 permissions:
13 contents: write
14 {{> jobYml jobName="Update CLI" }}
15 - name: Build documentation
16 run: npm run build -w cli
17 env:
18 # token is used to get files from `npm/cli` that
19 # are not present in the published tarball
20 GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
21 - name: Check for changes
22 id: status
23 run: |
24 if [ -n "$(git status --porcelain)" ]; then
25 echo "has_changes=1" >> "$GITHUB_OUTPUT"
26 fi
27 - name: Check in source updates
28 if: steps.status.outputs.has_changes == '1'
29 run: |
30 git add --verbose .
31 git commit -m 'CLI documentation update from CI'
32 git push origin main
33
34 publish:
35 needs: update-cli
36 if: needs.update-cli.outputs.has_changes == '1'
37 permissions:
38 contents: read
39 pages: write
40 id-token: write
41 actions: read
42 uses: ./.github/workflows/publish.yml