Skip to content

Commit

Permalink
Payload
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed May 24, 2024
1 parent af6c0c8 commit f8e8991
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
10 changes: 9 additions & 1 deletion .github/actions/slack/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ inputs:
runs:
using: "composite"
steps:
- id: prepare_payload
run: |
PAYLOAD=$(jq -n -c \
--arg msg "${{ inputs.message }}" \
'{blocks: [{type: "section", text: {type: "mrkdwn", text: $msg|@json}}]}')
echo "PAYLOAD=$PAYLOAD" >> $GITHUB_ENV
shell: bash
- uses: slackapi/slack-github-action@v1.26.0
env:
SLACK_BOT_TOKEN: ${{ inputs.token }}
with:
channel-id: ${{ inputs.channel }}
slack-message: ${{ inputs.message }}
# slack-message: ${{ inputs.message }}
payload: ${{ env.PAYLOAD }}
34 changes: 17 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
matrix:
ruby_version:
- '3.3'
- '3.2'
- '3.1'
- '3.0'
- '2.7'
# - '3.2'
# - '3.1'
# - '3.0'
# - '2.7'
steps:
- uses: actions/checkout@v4
- name: Ruby version
Expand All @@ -31,17 +31,17 @@ jobs:
run: gem -v
- name: Bundler version
run: bundle -v
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake spec
- name: Run tests with ITR
env:
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
DD_CIVISIBILITY_ITR_ENABLED: true
DD_API_KEY: ${{ secrets.DD_API_KEY }}
DD_ENV: ci
run: bundle exec rake spec
# - name: Install dependencies
# run: bundle install
# - name: Run tests
# run: bundle exec rake spec
# - name: Run tests with ITR
# env:
# DD_CIVISIBILITY_AGENTLESS_ENABLED: true
# DD_CIVISIBILITY_ITR_ENABLED: true
# DD_API_KEY: ${{ secrets.DD_API_KEY }}
# DD_ENV: ci
# run: bundle exec rake spec

notify:
needs: test
Expand All @@ -52,7 +52,7 @@ jobs:
name: Notify success
uses: ./.github/actions/slack
with:
message: |
message: |-
:github-check: [Test passed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})!
${{ github.ref_type }}: ${{ github.ref_name }}
Commit SHA: ${{ github.sha }}
Expand All @@ -63,7 +63,7 @@ jobs:
uses: ./.github/actions/slack
name: Notify failure
with:
message: |
message: |-
:red-light: [Test failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})!
${{ github.ref_type }}: ${{ github.ref_name }}
Commit SHA: ${{ github.sha }}
Expand Down

0 comments on commit f8e8991

Please sign in to comment.