SUKU some formatted files accepted #113
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
# This is a basic workflow that is manually triggered | |
name: Protocol converter workflow | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
name: | |
# Friendly description to be shown in the UI instead of 'name' | |
description: 'Person to greet' | |
# Default value if no value is explicitly provided | |
default: 'World' | |
# Input has to be provided for the workflow to run | |
required: true | |
push: | |
branches: | |
- master | |
paths: | |
- 'grid_common/grid_protocol.h' | |
- '.github/workflows/protocol_converter.yml' | |
- '.github/workflows/protocol_converter.py' | |
- '.github/workflows/documentation_validator.sh' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Checkout repository | |
run: | | |
git --version | |
git config --global user.email "[email protected]" | |
git config --global user.name "Intech Bot" | |
git clone https://${{ secrets.PERSONALACCESSTOKEN }}@github.com/intechstudio/grid-protocol.git | |
ls | |
- uses: actions/setup-python@v2 | |
- name: Setup python | |
run: | | |
python ./.github/workflows/protocol_converter.py grid_common/grid_protocol.h grid-protocol/grid_protocol_bot.json grid-protocol/package.json grid-protocol/grid-protocol/lists.py | |
- name: Check file | |
run: | | |
cd grid-protocol | |
cat -v grid_protocol_bot.json | |
if [[ `git status --porcelain` ]]; then | |
# Changes | |
git add -A | |
git commit -m "BOT protocol file synced from grid-fw repo" | |
git push | |
echo "changed=true" >> $GITHUB_ENV | |
else | |
# No changes | |
echo "changed=false" >> $GITHUB_ENV | |
fi | |
echo "CHANGED: ${{ env.changed }}" | |
- uses: tsickert/[email protected] | |
if: env.changed == 'true' | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
content: "Hello, I just updated the GRID_PROTOCOL.json file! Please update the Submodules in the grid-editor repository!" | |
- name: Clone documentation | |
run: | | |
git clone https://github.com/intechstudio/grid-documentation.git | |
sh ./.github/workflows/documentation_validator.sh >> report.txt | |
{ echo '{"content": "'; head -1 report.txt; echo '", "filename": "report.txt"}';} | tr "\n" " " > report.json | |
cat report.json | |
cat report.txt | |
- uses: tsickert/[email protected] | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
content: Here is your Grid API Documentation report! | |
filename: report.txt | |
- uses: tsickert/[email protected] | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
raw-data: report.json |