Skip to content

Commit

Permalink
added the package version in the alert
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeet-joy_xero committed Oct 18, 2024
1 parent 1a8d9ff commit bebeafc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 29 deletions.
12 changes: 11 additions & 1 deletion .github/actions/notify-slack/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ inputs:
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:
Expand Down Expand Up @@ -66,11 +72,15 @@ runs:
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:* \n ${{github.server_url}}/${{github.repository}}"
"text": "*Repository:* \n ${{inputs.repo_link}}"
},
{
"type": "mrkdwn",
"text": "*Status:*\n ${{inputs.job_status}}"
},
{
"type": "mrkdwn",
"text": "*Package Version:*\n ${{inputs.package_version}}"
}
]
},
Expand Down
54 changes: 26 additions & 28 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ jobs:
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: 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: Install dependencies
run: npm ci
working-directory: xero-node

# - name: Run Build
# run: npm run build
# 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
Expand Down Expand Up @@ -64,9 +64,6 @@ jobs:
repository: XeroAPI/xero-node
path: xero-node

- name: print release number
run: echo "release number - ${{needs.publish.outputs.release_number}}"

- name: Send slack notification on success
uses: ./xero-node/.github/actions/notify-slack
with:
Expand All @@ -76,6 +73,8 @@ jobs:
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
Expand All @@ -88,15 +87,14 @@ jobs:
repository: XeroAPI/xero-node
path: xero-node

- name: print release number
run: echo "release number - ${{needs.publish.outputs.release_number}}"

# - 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"
- 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}}

0 comments on commit bebeafc

Please sign in to comment.