Replies: 4 comments 3 replies
-
You can use the Here's an example: name: Notifier
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: |
echo "Running tests..."
exit 1
- name: Notify
if: failure()
uses: <user-name>/notifier-action@v1
with:
message: 'Workflow failed with an error.'
- name: Notify
if: success()
uses: <user-name>/notifier-action@v1
with:
message: 'Workflow passed successfully.' In this example, the notifier action is defined twice - once for success and once for failure. If any previous step of the job fails, the |
Beta Was this translation helpful? Give feedback.
-
@krutoo you found a solution for this? |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
I'm also looking to determine build status programmatically in Javascript. This would allow me to differentiate between two caches:
|
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
Hi, i want to write simple notifier GitHub action that sends messages when workflow passed successfully or failed with an error
I want to determine that any previous step of a job fails.
According to this docs i can make it in workflow yaml:
https://docs.github.com/en/actions/learn-github-actions/expressions#failure
How can i make it via javascript post action?
In my
action.yml
:In my
post.js
:Beta Was this translation helpful? Give feedback.
All reactions