Skip to content

Commit

Permalink
ari-stubs: Fix more local anchor references
Browse files Browse the repository at this point in the history
Also allow CreateDocs job to be run manually with default branches.
  • Loading branch information
gtjoseph committed Sep 5, 2023
1 parent 8ce313c commit b15287c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/CreateDocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
inputs:
branches:
description: "JSON array of branches: ['18','20'] (no spaces)"
required: true
required: false
type: string
schedule:
# Times are UTC
Expand All @@ -14,15 +14,29 @@ env:
ASTERISK_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BRANCHES: ${{ vars.WIKIDOC_BRANCHES }}
INPUT_BRANCHES: ${{ inputs.branches }}

jobs:

CreateDocsDebug:
runs-on: ubuntu-latest
outputs:
manual_branches: ${{ steps.setup.outputs.manual_branches }}
steps:
- name: setup
run: |
MANUAL_BRANCHES="$INPUT_BRANCHES"
[ -z "$MANUAL_BRANCHES" ] && MANUAL_BRANCHES="$DEFAULT_BRANCHES" || :
echo "manual_branches=${MANUAL_BRANCHES}"
echo "manual_branches=${MANUAL_BRANCHES}" >>${GITHUB_OUTPUT}
exit 0
- name: DumpEnvironment
uses: asterisk/asterisk-ci-actions/DumpEnvironmentAction@main
with:
action-vars: ${{toJSON(inputs)}}
action-inputs: ${{toJSON(inputs)}}
action-vars: ${{ toJSON(steps.setup.outputs) }}

CreateDocsScheduledMatrix:
needs: [ CreateDocsDebug ]
Expand Down Expand Up @@ -73,7 +87,7 @@ jobs:
strategy:
fail-fast: false
matrix:
branch: ${{ fromJSON(inputs.branches) }}
branch: ${{ fromJSON(needs.CreateDocsDebug.manual_branches) }}
runs-on: ubuntu-latest
steps:
- name: CreateDocs for ${{matrix.branch}}
Expand Down
4 changes: 2 additions & 2 deletions rest-api-templates/api.wiki.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
|:------ |:------------------------------------ |:------------ |:------- |
{{#apis}}
{{#operations}}
| {{http_method}} | [{{wiki_path}}](#{{nickname}}) | {{#response_class}}{{#is_primitive}}{{name}}{{/is_primitive}}{{^is_primitive}}[{{wiki_name}}]({{wiki_prefix}}Asterisk_REST_Data_Models#{{lc_singular_name}}){{/is_primitive}}{{/response_class}} | {{{summary}}} |
| {{http_method}} | [{{wiki_path}}](#{{nickname_lc}}) | {{#response_class}}{{#is_primitive}}{{name}}{{/is_primitive}}{{^is_primitive}}[{{wiki_name}}]({{wiki_prefix}}Asterisk_REST_Data_Models#{{lc_singular_name}}){{/is_primitive}}{{/response_class}} | {{{summary}}} |
{{/operations}}
{{/apis}}
{{#apis}}
{{#operations}}

---
[//]: # (anchor:{{nickname}})
[//]: # (anchor:{{nickname_lc}})
## {{nickname}}
### {{http_method}} {{wiki_path}}
{{{wiki_summary}}}{{#wiki_notes}} {{{wiki_notes}}}{{/wiki_notes}}
Expand Down
2 changes: 2 additions & 0 deletions rest-api-templates/swagger_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ class Operation(Stringify):
def __init__(self):
self.http_method = None
self.nickname = None
self.nickname_lc = None
self.response_class = None
self.parameters = []
self.summary = None
Expand All @@ -378,6 +379,7 @@ def load(self, op_json, processor, context):
validate_required_fields(op_json, self.required_fields, context)
self.http_method = op_json.get('httpMethod')
self.nickname = op_json.get('nickname')
self.nickname_lc = self.nickname.lower()
response_class = op_json.get('responseClass')
self.response_class = response_class and SwaggerType().load(
response_class, processor, context)
Expand Down

0 comments on commit b15287c

Please sign in to comment.