Skip to content

Commit

Permalink
docs: sync repo information with data from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Jan 11, 2022
1 parent 9f378f8 commit a3aa389
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/update-repo-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Sync repository info from package.json

env:
GH_TOKEN: ${{ secrets.UPDATE_REPO_INFO_PAT }}

on:
push:
branches:
- saga

jobs:
update_repo_info:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

# 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'`"
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"url": "git+https://github.com/NordicSemiconductor/random-words-js.git"
},
"keywords": [
"random",
"words",
"nRF Asset Tracker",
"Nordic Semiconductor"
"random-words",
"nrf-asset-tracker",
"iot"
],
"author": "Nordic Semiconductor ASA | nordicsemi.no",
"license": "BSD-3-Clause",
Expand Down

0 comments on commit a3aa389

Please sign in to comment.