{"id":26905140,"url":"https://github.com/jimdo/should-i-notify-action","last_synced_at":"2025-04-01T10:56:13.135Z","repository":{"id":43280542,"uuid":"329850238","full_name":"Jimdo/should-i-notify-action","owner":"Jimdo","description":"A github action that tells if I need to send a slack notification. It avoids spamming your notification channels with successful builds.","archived":false,"fork":false,"pushed_at":"2023-08-02T13:28:30.000Z","size":6,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-19T08:02:25.689Z","etag":null,"topics":["github-actions","owner-team-wonderland"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jimdo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-15T08:16:46.000Z","updated_at":"2024-01-24T05:15:27.000Z","dependencies_parsed_at":"2024-11-17T15:46:24.817Z","dependency_job_id":null,"html_url":"https://github.com/Jimdo/should-i-notify-action","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimdo%2Fshould-i-notify-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimdo%2Fshould-i-notify-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimdo%2Fshould-i-notify-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimdo%2Fshould-i-notify-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jimdo","download_url":"https://codeload.github.com/Jimdo/should-i-notify-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246628272,"owners_count":20808106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","owner-team-wonderland"],"created_at":"2025-04-01T10:56:12.575Z","updated_at":"2025-04-01T10:56:13.129Z","avatar_url":"https://github.com/Jimdo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Should I notify?\nA GitHub action to decide if a status message should be pushed to slack for this build\n\n**WARNING:** This action sends NO notification!\n\n## How it makes the decision\n\n1. If the current build failed, then it will recommend sending the message\n2. If the current build succeeded, and the previous one failed, then it will recommend sending the message\n3. If the current build succeeded, and the previous one succeeded, then it will recommend NOT sending the message\n\n## Inputs\n\n### needs_context\n\n**required** json representation of the `needs` object in your context (`toJson(needs)`)\n\n### branch\n\n**required** The branch to get the status from\n\n### github_token\n\n**required** A github token (secrets.GITHUB_TOKEN will suffice)\n\n## Outputs\n\n### should_send_message\n\n`yes|no` depending on if the message should be sent\n\n## How to use\n\nIn this case, the action will take into account the result of `job1` and `job2` for builds only for the `main` branch. \n\n```yaml\njob1:\n  runs-on: ubuntu-latest\n  steps:\n    - uses: actions/checkout@v2\n    - name: Run the script\n      run: ./script1.sh\njob2:\n  runs-on: ubuntu-latest\n  steps:\n    - uses: actions/checkout@v2\n    - name: Run the script\n      run: ./script2.sh\n      \nslack-workflow-status:\n  name: Post workflow status To Slack\n  needs:\n    - job1\n    - job2\n  if: always() \u0026\u0026 github.ref == 'refs/heads/main'\n  runs-on: ubuntu-latest\n  permissions:\n    actions: read\n  steps:\n    - name: Determine if we need to notify\n      uses: Jimdo/should-i-notify-action@main\n      id: should_notify\n      with:\n        branch: main\n        needs_context: ${{ toJson(needs) }}\n        github_token: ${{ secrets.GITHUB_TOKEN }}\n\n    - name: Slack workflow notification\n      if: steps.should_notify.outputs.should_send_message == 'yes'\n      uses: Gamesight/slack-workflow-status@master\n      with:\n        repo_token: ${{secrets.GITHUB_TOKEN}}\n        slack_webhook_url: 'https://hooks.slack.com/services/...'\n        channel: 'notifications-slack-channel'\n        name: 'Your great build bot'\n```\n\n**INFO:** The documentation of slack-workflow-status action [states](https://github.com/Gamesight/slack-workflow-status/pull/41) that the action needs `action: read` permissions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimdo%2Fshould-i-notify-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimdo%2Fshould-i-notify-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimdo%2Fshould-i-notify-action/lists"}