Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .github/actions/add_pr_comment/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
fi

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Packages
run: pip install -r requirements_dev.txt
Expand Down
52 changes: 34 additions & 18 deletions .github/workflows/listener.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# Ingest repository_dispatch events and trigger appropriate actions
# Ingest repository_dispatch events and trigger appropriate actions
name: Listener

on:
repository_dispatch:
types: [Build]

jobs:
build:
build:
if: ${{ github.event.action == 'Build' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Build SDK and Open PR
- name: Build SDK and Open PR
uses: Bandwidth/generate-sdk-action@v1.0.0
with:
with:
branch-name: ${{ github.event.client_payload.branchName }}
username: ${{ secrets.DX_GITHUB_USERNAME }}
token: ${{ secrets.DX_GITHUB_TOKEN }}
openapi-generator-version: v5.4.0
language: python
language: python
config: ./openapi-config.yml
env:
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

- name: Open Pull Request
run: |
exists=$(hub pr list -h {{ inputs.branch-name }})
Expand All @@ -34,18 +34,34 @@ jobs:
echo "PR already exists for this branch"
fi
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
- name: Output PR Number
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

- name: Output PR Number
id: output-pr-number
run: echo "PR_NUMBER=$(hub pr list -h ${{ inputs.branch-name }} -f %I)" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

- uses: ./.github/actions/add_pr_comment
with:
username: ${{ secrets.DX_GITHUB_USERNAME }}
token: ${{ secrets.DX_GITHUB_TOKEN }}
repo-name: api-specs
pr-number: ${{ github.event.client_payload.prNumber }}
message: 'Python SDK built successfully\n\nSee the corresponding PR opened on the SDK repository (no action required):\nhttps://github.com/Bandwidth/api-docs/pull/${{ env.PR_NUMBER }}'
- uses: actions/github-script@v6
with:
github-token: ${{secrets.DX_GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: ${{ github.event.client_payload.prNumber }},
owner: context.repo.owner,
repo: 'api-specs',
body: 'Python SDK built successfully\n\nSee the corresponding PR opened on the SDK repository (no action required):\nhttps://github.com/Bandwidth/api-docs/pull/${{ env.PR_NUMBER }}'
})

- name: Notify for Failure
uses: actions/github-script@v6
if: failure()
with:
github-token: ${{secrets.DX_GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: ${{ github.event.client_payload.prNumber }},
owner: context.repo.owner,
repo: 'api-specs',
body: 'Python SDK failed to build successfully\n\nSee the Python SDK repository [action logs](https://github.com/Bandwidth/python-sdk/actions) for more information.'
})