Skip to content

+ 7f503db5e9d4c95c18db1f7757b2493e7a44a15e #4

+ 7f503db5e9d4c95c18db1f7757b2493e7a44a15e

+ 7f503db5e9d4c95c18db1f7757b2493e7a44a15e #4

Workflow file for this run

name: notify

Check failure on line 1 in .github/workflows/.notify.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/.notify.yml

Invalid workflow file

(Line: 18, Col: 9): Unrecognized named-value: 'secrets'. Located at position 79 within expression: inputs.job_result == 'failure' && github.repository == 'OpenSIPS/opensips' && secrets.SLACK_BOT_TOKEN != ''
on:
workflow_call:
inputs:
job_name:
required: true
type: string
job_result:
required: true
type: string
secrets:
SLACK_BOT_TOKEN:
required: false
jobs:
notify_slack:
if: ${{ inputs.job_result == 'failure' && github.repository == 'OpenSIPS/opensips' && secrets.SLACK_BOT_TOKEN != '' }}
runs-on: ubuntu-latest
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
steps:
- name: Notify slack fail
uses: slackapi/slack-github-action@v3.0.3
with:
method: chat.postMessage
token: ${{ env.SLACK_BOT_TOKEN }}
payload: |
channel: devel
text: ":x: ${{ inputs.job_name }} failed in ${{ github.repository }}"
blocks:
- type: section
text:
type: mrkdwn
text: ":x: *${{ inputs.job_name }}* failed in *${{ github.repository }}*"
- type: context
elements:
- type: mrkdwn
text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Open this run in GitHub Actions>"
- name: Post Fail
run: |
echo "💥 \"${{ inputs.job_name }}\" failed – marking workflow 💩" >&2
exit 1