diff --git a/.github/actions/notify-slack/action.yml b/.github/actions/notify-slack/action.yml index b65583c4..0f89a0a4 100644 --- a/.github/actions/notify-slack/action.yml +++ b/.github/actions/notify-slack/action.yml @@ -3,37 +3,29 @@ description: "Action to send slack payload to public-sdk-events channel" inputs: heading_text: - required: false + required: true description: "Heading of the slack payload" alert_type: - required: false + required: true description: "type of the slack alert" job_status: - required: false + required: true description: "status of the job" XERO_SLACK_WEBHOOK_URL: - required: false + required: true description: "webhook url for channel - public-sdk-events" job_url: - required: false + required: true description: "job event link" button_type: - required: false - description: "color for the logs button" + required: true + description: "color for the check logs button" runs: using: "composite" steps: - # - name: testing - # shell: bash - # run: | - # echo ${{inputs.alert_type}} - # echo ${{inputs.heading_text}} - # echo ${{inputs.job_status}} - # echo ${{github.repository}} - # echo ${{github.sha}} - name: Send slack notification id: slack @@ -79,10 +71,6 @@ runs: { "type": "mrkdwn", "text": "*Status:*\n ${{inputs.job_status}}" - }, - { - "type": "mrkdwn", - "text": "*Commit:*\n ${{github.sha}}" } ] }, diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6cc8069a..a5c7e051 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,11 @@ on: 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 @@ -32,6 +37,15 @@ jobs: # 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" + env: + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Publish to npm # env: # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -49,6 +63,9 @@ 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: