Skip to content

Commit

Permalink
chore: rename echo to bridge everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-kralj-novu committed Jun 17, 2024
1 parent eee6248 commit bc5db5f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Sync Echo State'
description: 'Sync state from your Echo deployment to Novu cloud'
name: 'Sync Bridge State'
description: 'Sync state from your Bridge deployment to Novu cloud'
author: 'Novu'

# Add your action's branding here. This will appear on the GitHub Marketplace.
Expand All @@ -12,11 +12,11 @@ inputs:
novu-api-key:
description: 'Your Novu API key'
required: true
echo-url:
description: 'Your Echo deployment endpoint URL'
bridge-url:
description: 'Your Bridge deployment endpoint URL'
required: true
backend-url:
description: 'Your Echo deployment endpoint URL'
api-url:
description: 'Your Novu cloud API base URL'
required: false
default: 'https://api.novu.co'

Expand Down
18 changes: 9 additions & 9 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@novuhq/echo-sync-action",
"name": "@novuhq/bridge-sync-action",
"description": "GitHub Actions TypeScript template",
"version": "0.0.0",
"author": "",
Expand Down
22 changes: 11 additions & 11 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ import { createHmac } from 'crypto'
*/
export async function run(): Promise<void> {
try {
const echoUrl: string = core.getInput('echo-url')
const bridgeUrl: string = core.getInput('bridge-url')

// Debug logs are only output if the `ACTIONS_STEP_DEBUG` secret is true
core.debug(`Echo URL ${echoUrl} ...`)
core.debug(`Bridge URL ${bridgeUrl} ...`)

const inputs = {
novuApiKey: core.getInput('novu-api-key'),
echoUrl: core.getInput('echo-url'),
backendUrl: core.getInput('backend-url')
bridgeUrl: core.getInput('bridge-url'),
apiUrl: core.getInput('api-url')
}

const response = await syncState(
inputs.echoUrl,
inputs.bridgeUrl,
inputs.novuApiKey,
inputs.backendUrl
inputs.apiUrl
)

// Set outputs for other workflow steps to use
Expand All @@ -35,12 +35,12 @@ export async function run(): Promise<void> {
}

export async function syncState(
echoUrl: string,
bridgeUrl: string,
novuApiKey: string,
backendUrl: string
apiUrl: string
): Promise<object> {
const timestamp = Date.now()
const discover = await axios.get(`${echoUrl}?action=discover`, {
const discover = await axios.get(`${bridgeUrl}?action=discover`, {
headers: {
'x-novu-signature': `t=${timestamp},v1=${createHmac('sha256', novuApiKey)
.update(`${timestamp}.${JSON.stringify({})}`)
Expand All @@ -49,9 +49,9 @@ export async function syncState(
})

const sync = await axios.post(
`${backendUrl}/v1/echo/sync?source=githubAction`,
`${apiUrl}/v1/bridge/sync?source=githubAction`,
{
chimeraUrl: echoUrl,
bridgeUrl,
workflows: discover.data.workflows
},
{
Expand Down

0 comments on commit bc5db5f

Please sign in to comment.