Code Monkey home page Code Monkey logo

action-slack-incoming-webhook's People

Contributors

dependabot[bot] avatar joltcoke avatar jtyler258 avatar swfz avatar tokorom avatar yuzurus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

action-slack-incoming-webhook's Issues

Error: Request failed with status 400

Issue scenario:

Am using the below code to trap a release and then send a slack notification and am getting error "Error: Request failed with status 400". The notification works for every other event like deployment created, succeeded etc, except for release published. This used to work, and has broken in the 2 months or so. I strongly believe that this is a GITHUB issue as this error doesnt occur if I create a release manually from github portal. When I create a release from github code shown below, the error from slack .
I will open a case with Git and see how it goes and update here.

  - name: Release Published
    if: github.event_name == 'release' && github.event.action == 'released' 
    uses: tokorom/action-slack-incoming-webhook@master
    env:
      INCOMING_WEBHOOK_URL: ${{env.SLACK_CHANNEL_WEBHOOK}}
      TITLE: ":loudspeaker: *<${{github.event.release.html_url}}|${{github.event.repository.name}} ${{github.event.release.tag_name}}>* is ready for verification testing."
      BODY: "*${{github.event.release.name}} Release Notes*\n${{github.event.release.body}}"
      BUTTON: "Open ${{github.event.release.tag_name}}"
      URL: ${{github.event.release.html_url}}
      FOOTER: ":information_source: *<${{ github.event.repository.html_url }}|${{github.event.repository.name}} repository>*"
    with:
      text: "CHAdminTable Production Released"

Code to create the release. This release creation event triggers the above code to send slack notification and fails. If the release is created manually from GIT, the slack notification comes through just fine.

  - shell: pwsh
    name: Get the app version from chart.yml
    run: |
            $RELEASE_NUMBER = (get-content .\charts\Metricon.ClickHome.AdminTables.Web\Chart.yaml| ConvertFrom-Yaml | Select version).version
            Write-Output "::set-env name=RELEASE_NUMBER::$RELEASE_NUMBER"
            $env:ReleaseNotes | out-file releasenotes.txt
  - name: Create Release
    id: create_release
    uses: actions/create-release@v1
    env:
      GITHUB_CONTEXT: ${{ toJson(github) }}
      GITHUB_TOKEN: ${{ env.Password }}
    with:
      tag_name: ${{ env.RELEASE_NUMBER }}
      release_name: ${{ env.RELEASE_NUMBER }}
      body_path: releasenotes.txt
      draft: true
      prerelease: false

#echo "RELEASE_NUMBER=$RELEASE_NUMBER" >> $GITHUB_ENV - this isnt working.
#https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions

`set-output` command is deprecated

After running action, I see warning:

Warning: The set-output command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Will be PR for this?

Thanks!

I could not notify with Attachments / Block to Slack using this package.

Hello.

I could not notify with Attachments / Block to Slack.
When I use Attachments like this, It will only appear as shown in the photo below.

...
- name: Slack Incoming Webhook
  if: success()
  uses: tokorom/[email protected]
  env:
    INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  with:
    text: This is test.
    attachments: |
      [
        {
          "color": "good",
          "author_name": "${{ github.actor }}",
          "author_icon": "${{ github.event.sender.avatar_url }}",
          "fields": [
            {
              "title": "GitHub Actions URL",
              "value": "${{ github.event.repository.url }}/actions/runs/${{ github.run_id }}"
            }
          ]
        }
      ]

2021-01-02_18h04_18


Also, I use Block payload like this.
I could not catch the notify.

# Slack notify
- name: Slack Incoming Webhook
  if: success()
  uses: tokorom/[email protected]
  env:
    INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  with:
    blocks: |
      [
        {
          "type": "section",
          "text": {
            "type": "plain_text",
            "text": "ブログの更新が完了したよ!",
            "emoji": true
          }
        },
        {
          "type": "divider"
        },
        {
          "type": "context",
          "elements": [
            {
              "type": "image",
              "image_url": "${{ github.event.sender.avatar_url }}",
              "alt_text": "github avatar"
            },
            {
              "type": "mrkdwn",
              "text": ": ${{ github.actor }}"
            }
          ]
        },
        {
          "type": "context",
          "elements": [
            {
              "type": "plain_text",
              "text": "Commit Message :",
              "emoji": true
            }
          ]
        },
        {
          "type": "context",
          "elements": [
            {
              "type": "plain_text",
              "text": "GitHub Actions URL :"
            },
            {
              "type": "mrkdwn",
              "text": "${{ github.event.repository.url }}/actions/runs/${{ github.run_id }}"
            }
          ]
        }
      ]

I want to solve problem because I want to use this package to notify my Slack.
I have no idea to solve this problem. Plz give me an idea.

Thank you :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.