Skip to content

Scan and Notify Testing Items #2

Scan and Notify Testing Items

Scan and Notify Testing Items #2

name: Scan and Notify Testing Items
on:
schedule:
# Trigger every Sunday at 12:00
- cron: '0 12 * * 0'
workflow_dispatch:
inputs:
github_org:
description: "GitHub organization"
default: "longhorn"
required: true
github_repo:
description: "GitHub repository"
default: "longhorn"
required: true
github_project:
description: "GitHub project"
default: "Longhorn Sprint"
required: true
env:
GITHUB_ORG: longhorn
GITHUB_REPO: longhorn
GITHUB_PROJECT: Longhorn Sprint
jobs:
scan_and_notify_testing_items:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install requests
- name: Scan and Notify Testing Items
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_LONGHORN_QA_WEBHOOK_URL }}
USER_MAPPING: ${{ secrets.USER_MAPPING_FOR_GITHUB_SLACK }}
run: |
github_org="${GITHUB_ORG}"
github_repo="${GITHUB_REPO}"
github_project="${GITHUB_PROJECT}"
if [ -n "${{ github.event.inputs.github_org }}" ]; then
github_org="${{ github.event.inputs.github_org }}"
fi
if [ -n "${{ github.event.inputs.github_repo }}" ]; then
github_repo="${{ github.event.inputs.github_repo }}"
fi
if [ -n "${{ github.event.inputs.github_project }}" ]; then
github_project="${{ github.event.inputs.github_project }}"
fi
python ./.github/workflows/scan-and-notify-testing-items.py "${github_org}" "${github_repo}" "${github_project}"