-
-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (33 loc) · 1.27 KB
/
update-repo-info.yaml
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
36
37
38
39
40
name: Sync repository info from package.json
env:
GH_TOKEN: ${{ secrets.UPDATE_REPO_INFO_PAT }}
on:
push:
branches:
- saga
paths:
- "package.json"
- ".github/workflows/update-repo-info.yaml"
jobs:
update_repo_info:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Currently ships with 2.3.0 which does not have repo edit
- name: Update GitHub CLI
run: |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
gh --version
- name: Sync repository description
run:
gh repo edit --description "`cat package.json | jq -r '.description'`"
- name: Sync repository topics
run:
cat package.json | jq '.keywords[]' | xargs -I'{}' gh repo edit
--add-topic {}
- name: Sync homepage
run: gh repo edit --homepage "`cat package.json | jq -r '.homepage'`"