Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
44b1953
adds publish to npm step
Sep 27, 2024
a2fa708
adds working directory to publish step
Sep 27, 2024
02c4fa3
corrected publish step
Sep 27, 2024
48bc9cc
corrected environment variable
Sep 27, 2024
0fb3736
adds access
Sep 27, 2024
d7d9d11
removes registry
Sep 27, 2024
c4ccc6e
removed public access
Sep 27, 2024
93185b3
corrected auth token
Sep 27, 2024
b73ac9b
adds debug step
Sep 27, 2024
26348b4
remove debug step
Sep 27, 2024
2834ee9
removed public access
Sep 27, 2024
83a29e5
corrected auth token
Sep 27, 2024
98520af
corrected env variable
Sep 27, 2024
53810ed
adds permissions
Sep 27, 2024
f79b605
removed provenence
Sep 27, 2024
70bfdc8
add a login step
Sep 27, 2024
b944c2f
removed public access
Sep 27, 2024
5e63c61
adds public access step
Sep 30, 2024
0ad6e4f
try removing registry
Sep 30, 2024
8df08b0
use NPM token instead
Sep 30, 2024
fc9d752
use node-auth-token
Sep 30, 2024
516f855
remove public access
Sep 30, 2024
1428845
remove build step
Sep 30, 2024
7ba95de
final commit
Sep 30, 2024
00d7fa4
try removing permissions
Sep 30, 2024
e7a0999
adds registry url
Sep 30, 2024
624e63c
runs build before publishing
Sep 30, 2024
00fd217
increase version
Sep 30, 2024
947cbaa
increase version
Sep 30, 2024
fa23e28
Final Commit
Sep 30, 2024
828f99f
adds a step to check for vulnerabilities
Sep 30, 2024
ef1f366
fixed vulnerablities
Sep 30, 2024
e01d970
adds working directory
Sep 30, 2024
76b3b94
Revert "fixed vulnerablities"
Sep 30, 2024
9439545
fixed vulnerablities
Sep 30, 2024
17f94f0
updated package version
Sep 30, 2024
399c7a0
updated outdated packages
Oct 1, 2024
0833e9a
corrected audit command
Oct 1, 2024
60c2c8a
ci: Added the slack alert pipeline code
sangeet-joy-tw Oct 21, 2024
f83df63
feat: Added the code for binary data type
Oct 28, 2024
87e135e
new model changes
Nov 5, 2024
7879612
Create Cortex ID
vigneshk-tw Nov 28, 2024
ebc9e1e
Revert "Create Cortex ID"
vigneshk-tw Nov 28, 2024
0c8a398
Merge branch 'master' of https://github.com/XeroAPI/xero-node into fe…
Mar 10, 2025
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
103 changes: 103 additions & 0 deletions .github/actions/notify-slack/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: slack-alert-action
description: "Action to send slack payload to public-sdk-events channel"

inputs:
heading_text:
required: true
description: "Heading of the slack payload"
alert_type:
required: true
description: "type of the slack alert"
job_status:
required: true
description: "status of the job"
XERO_SLACK_WEBHOOK_URL:
required: true
description: "webhook url for channel - public-sdk-events"
job_url:
required: true
description: "job run id link"
button_type:
required: true
description: "color for the check logs button"
package_version:
required: true
description: "released package version"
repo_link:
required: true
description: "link of the repo"


runs:
using: "composite"

steps:

- name: Send slack notification
id: slack
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: ${{inputs.XERO_SLACK_WEBHOOK_URL}}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload: |
{
"blocks": [
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "${{inputs.heading_text}} ",
"style": {
"bold": true
}
},
{
"type": "emoji",
"name": "${{inputs.alert_type}}"
}
]
}
]
},
{
"type": "divider"
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:* \n ${{inputs.repo_link}}"
},
{
"type": "mrkdwn",
"text": "*Status:*\n ${{inputs.job_status}}"
},
{
"type": "mrkdwn",
"text": "*Package Version:*\n ${{inputs.package_version}}"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Check the logs",
"emoji": true
},
"style": "${{inputs.button_type}}",
"url": "${{inputs.job_url}}"
}
]
}
]
}
5 changes: 4 additions & 1 deletion .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'


- name: Install dependencies
run: npm ci
working-directory: xero-node

- name: Check for vulnerabilities
run: npm audit || true
working-directory: xero-node

- name: Run Build
run: npm run build
working-directory: xero-node
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Publish
on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
outputs:
release_number: ${{steps.get_latest_release_number.outputs.release_tag}}
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout xero-node repo
uses: actions/checkout@v4
with:
repository: XeroAPI/xero-node
path: xero-node

- name: Set up Node environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci
working-directory: xero-node

- name: Run Build
run: npm run build
working-directory: xero-node

- name: Fetch Latest release number
id: get_latest_release_number
run: |
latest_version=$(gh release view --json tagName --jq '.tagName')
echo "Latest release version is - $latest_version"
echo "::set-output name=release_tag::$latest_version"
working-directory: xero-node
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish
working-directory: xero-node

notify-slack-on-success:
runs-on: ubuntu-latest
needs: publish
if: success()
steps:
- name: Checkout xero-node repo
uses: actions/checkout@v4
with:
repository: XeroAPI/xero-node
path: xero-node

- name: Send slack notification on success
uses: ./xero-node/.github/actions/notify-slack
with:
heading_text: "Publish job has succeeded !"
alert_type: "thumbsup"
job_status: "Success"
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
button_type: "primary"
package_version: ${{needs.publish.outputs.release_number}}
repo_link: ${{github.server_url}}/${{github.repository}}

notify-slack-on-failure:
runs-on: ubuntu-latest
needs: publish
if: failure()
steps:
- name: Checkout xero-node repo
uses: actions/checkout@v4
with:
repository: XeroAPI/xero-node
path: xero-node

- name: Send slack notification on failure
uses: ./xero-node/.github/actions/notify-slack
with:
heading_text: "Publish job has failed !"
alert_type: "alert"
job_status: "Failed"
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
button_type: "danger"
package_version: ${{needs.publish.outputs.release_number}}
repo_link: ${{github.server_url}}/${{github.repository}}
Loading