Add zulip alert for CVE scan #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test zulip | |
on: | |
push: | |
branches: [zulip-alert] | |
permissions: | |
contents: read | |
jobs: | |
test-zulip: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- run: gh run view ${GITHUB_RUN_ID} --repo ${GITHUB_REPO} --json jobs --jq .jobs > jobs.json | |
env: | |
GITHUB_RUN_ID: ${{ github.run_id }} | |
GITHUB_REPO: ${{ github.repository }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Scan flux-operator | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
id: job-url | |
with: | |
script: | | |
const jobs = require('./jobs.json') | |
const job = jobs.find(job => job.name === process.env.JOB_NAME) | |
const step = job.steps.find(step => step.name === process.env.STEP_NAME) | |
return `${job.url}#step:${step.number}:1` | |
env: | |
JOB_NAME: ${{ github.job }} | |
STEP_NAME: Scan flux-operator | |
- run: 'echo "Job URL: ${{ steps.job-url.outputs.result }}"' | |
- uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2 | |
with: | |
email: ${{ secrets.ZULIP_EMAIL }} | |
api-key: ${{ secrets.ZULIP_API_KEY }} | |
organization-url: ${{ secrets.ZULIP_ORGANIZATION_URL }} | |
type: stream | |
to: test-bots | |
topic: test-topic | |
content: | | |
Test zulip from github action | |
CVE Report URL: ${{ steps.job-url.outputs.result }} |