forked from npm/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-cli.yml
More file actions
35 lines (32 loc) · 994 Bytes
/
update-cli.yml
File metadata and controls
35 lines (32 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Update CLI
on:
workflow_dispatch:
schedule:
- cron: "14 2 * * *"
jobs:
update-cli:
outputs:
has_changes: $\{{ steps.status.outputs.has_changes }}
{{> job jobName="Update CLI" }}
- name: Build documentation
run: npm run build -w cli
env:
# token is used to get files from `npm/cli` that
# are not present in the published tarball
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
- name: Check for changes
id: status
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::set-output name=has_changes::1"
fi
- name: Check in source updates
if: steps.status.outputs.has_changes == '1'
run: |
git add --verbose .
git commit -m 'CLI documentation update from CI'
git push origin main
publish:
needs: update-cli
if: needs.update-cli.outputs.has_changes == '1'
uses: ./.github/workflows/publish.yml