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 {{> jobYml jobName="Update CLI" }}
13 - name: Build documentation
14 run: npm run build -w cli
15 env:
16 # token is used to get files from `npm/cli` that
17 # are not present in the published tarball
18 GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
19 - name: Check for changes
20 id: status
21 run: |
22 if [ -n "$(git status --porcelain)" ]; then
23 echo "::set-output name=has_changes::1"
24 fi
25 - name: Check in source updates
26 if: steps.status.outputs.has_changes == '1'
27 run: |
28 git add --verbose .
29 git commit -m 'CLI documentation update from CI'
30 git push origin main
31
32 publish:
33 needs: update-cli
34 if: needs.update-cli.outputs.has_changes == '1'
35 uses: ./.github/workflows/publish.yml