Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.
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.

55 changes: 33 additions & 22 deletions .github/workflows/listener.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,17 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

# Comment on PR
- name: Comment on Corresponding Repo
uses: ./.github/actions/add_pr_comment
with:
username: ${{ secrets.DX_GITHUB_USERNAME }}
token: ${{ secrets.DX_GITHUB_TOKEN }}
repo-name: ${{ github.event.client_payload.originRepo }}
pr-number: ${{ github.event.client_payload.prNumber }}
message: 'Preview site: http://bw-api-docs-${{ env.BRANCH_NAME }}.s3-website-us-east-1.amazonaws.com/\nPlease note that it may take a couple minutes for your preview site to become available.\n\nSee the corresponding PR opened on the docsite repository (no action required):\nhttps://github.com/Bandwidth/api-docs/pull/${{ env.PR_NUMBER }}'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: ${{ github.event.client_payload.prNumber }},
owner: 'Bandwidth',
repo: ${{ github.event.client_payload.originRepo }},
body: 'Preview site: http://bw-api-docs-${{ env.BRANCH_NAME }}.s3-website-us-east-1.amazonaws.com/\nPlease note that it may take a couple minutes for your preview site to become available.\n\nSee the corresponding PR opened on the docsite repository (no action required):\nhttps://github.com/Bandwidth/api-docs/pull/${{ env.PR_NUMBER }}'
})

merge:
if: ${{ github.event.action == 'Merge' }}
Expand All @@ -63,13 +66,17 @@ jobs:
env:
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-docs
pr-number: ${{ env.PR_NUMBER }}
message: 'Corresponding Pull Request on [${{ github.event.client_payload.originRepo }}](https://github.com/Bandwidth/${{ github.event.client_payload.originRepo }}/pull/${{ github.event.client_payload.prNumber }}) was merged.'
# Comment on PR
- name: Comment on Corresponding Repo
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: ${{ env.PR_NUMBER }},
owner: 'Bandwidth',
repo: 'api-docs',
body: 'Corresponding Pull Request on [${{ github.event.client_payload.originRepo }}](https://github.com/Bandwidth/${{ github.event.client_payload.originRepo }}/pull/${{ github.event.client_payload.prNumber }}) was merged.'
})

close:
if: ${{ github.event.action == 'Close' }}
Expand All @@ -88,14 +95,18 @@ jobs:
env:
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-docs
pr-number: ${{ env.PR_NUMBER }}
message: 'Corresponding Pull Request on [${{ github.event.client_payload.originRepo }}](https://github.com/Bandwidth/${{ github.event.client_payload.originRepo }}/pull/${{ github.event.client_payload.prNumber }}) was closed.'

# Comment on PR
- name: Comment on Corresponding Repo
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: ${{ env.PR_NUMBER }},
owner: 'Bandwidth',
repo: 'api-docs',
body: 'Corresponding Pull Request on [${{ github.event.client_payload.originRepo }}](https://github.com/Bandwidth/${{ github.event.client_payload.originRepo }}/pull/${{ github.event.client_payload.prNumber }}) was closed.'
})

change_draft_status:
if: ${{ github.event.action == 'Draft' }}
runs-on: ubuntu-latest
Expand Down