-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0075202
commit b2420ca
Showing
4 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: "Channel Invites Acceptances (develop)" | ||
run-name: "cron to review acceptances (develop)" | ||
on: | ||
push: | ||
branches: | ||
- feature-workflows | ||
#schedule: | ||
#- cron: "0 0 * * 0" | ||
|
||
jobs: | ||
cron: | ||
runs-on: "ubuntu-latest" | ||
env: | ||
CHANNEL: ${{ secrets.ST_CHANNEL_DEVELOP }} | ||
steps: | ||
- name: "checkout" | ||
uses: "actions/checkout@v3" | ||
|
||
- name: "setup smartthings cli" | ||
uses: "actions/setup-node@v3" | ||
with: | ||
node-version: "20.9.0" | ||
- run: "npm install --global @smartthings/cli" | ||
|
||
- name: "test step" | ||
run: "git status" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: "update channel information" | ||
uses: "actions/checkout@v3" | ||
- run: | | ||
CHANNEL_INFO=$(smartthings edge:channels:invites "$CHANNEL" --json); | ||
NAME=$(echo $CHANNEL_INFO | jq .metadata.name); | ||
OWNER=$(echo $CHANNEL_INFO | jq .metadata.owner); | ||
DESCRIPTION=$(echo $CHANNEL_INFO | jq .metadata.description); | ||
TERMS=$(echo $CHANNEL_INFO | jq .metadata.termsUrl); | ||
ACCEPTANCES=$(echo $CHANNEL_INFO | jq .acceptances); | ||
ACCEPT_URL=$(echo $CHANNEL_INFO | jq .acceptUrl); | ||
python -c " | ||
from sys import argv | ||
template = ''' | ||
- **Name**: {} | ||
- **Owner**: {} | ||
- **Description**: {} | ||
- **Terms URL**: {} | ||
- **Acceptances**: {} | ||
<a href=\"{}\">Accept Invite</a> | ||
''' | ||
template = template.format(argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]) | ||
content = None | ||
with open('readme_template', 'r') as template_doc: | ||
tag = 'channel-info-here' | ||
content = template_doc.read() | ||
content = content.replace(tag, template) | ||
with open('README.md', 'w') as readme: | ||
readme.write(content) | ||
" "$NAME" "$OWNER" "$DESCRIPTION" "$TERMS" "$ACCEPTANCES" "$ACCEPT_URL"; | ||
cat README.md; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
# Edge Drivers for Zigbee and LAN devices | ||
|
||
### Channel | ||
|
||
- Name: erick | ||
- Owner: lala | ||
- Description: cas | ||
- Terms URL: ca | ||
- Acceptances: dasf | ||
|
||
<a href="adsf">Accept Invite</a> | ||
|
||
|
||
### Index | ||
|
||
- [Zigbee Edge Drivers](./zigbee) | ||
- [Zigbee Edge Drivers](./zigbee) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Edge Drivers for Zigbee and LAN devices | ||
|
||
### Channel | ||
channel-info-here | ||
### Index | ||
|
||
- [Zigbee Edge Drivers](./zigbee) |