Skip to content

Commit

Permalink
testing the flow
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeet-joy_xero committed Oct 16, 2024
1 parent 05bfcbc commit d26935b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ inputs:
required: true
alert_type:
required: true
job_status:
required: true

runs:
using: "composite"
Expand All @@ -15,6 +17,7 @@ runs:
run: |
echo ${{inputs.alert_type}}
echo ${{inputs.heading_text}}
# - name: Send slack notification
# id: slack
# uses: slackapi/slack-github-action@v1.27.0
Expand All @@ -35,8 +38,8 @@ runs:
# "short": true
# },
# {
# "title": "Job",
# "value": ""
# "title": "Job Status",
# "value": "${{inputs.job_status}}"
# "short": true
# },
# {
Expand Down
59 changes: 30 additions & 29 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,44 @@ 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: 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
# 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

- name: Send slack notification on success
uses: ./xero-node/.github/actions/notify-slack
with:
heading_text: "Publish job has succeeded !"
alert_type: "good"
# - name: Send slack notification on success
# uses: ./xero-node/.github/actions/notify-slack
# with:
# heading_text: "Publish job has succeeded !"
# alert_type: "good"
# job_status: ${{job.status}}

notify-slack-on-failure:
runs-on: ubuntu-latest
Expand All @@ -67,7 +67,8 @@ jobs:
path: xero-node

- name: Send slack notification on failure
uses: ./xero-node/.github/actions/notify-slack
uses: ./xero-node/.github/actions/notification
with:
heading_text: "Publish job has failed, Please check the logs"
alert_type: "danger"
job_status: ${{job.status}}

0 comments on commit d26935b

Please sign in to comment.