name: Add labels standardized

on:
  issues:
    types:
      - opened
      - reopened

permissions: {}

jobs:
  add-issue-labels:
    permissions:
      issues: write
    secrets:
      ORG_MEMBERSHIP_TOKEN: ${{ secrets.ORG_MEMBERSHIP_TOKEN }}
      SENZING_MEMBERS: ${{ secrets.SENZING_MEMBERS }}
    uses: senzing-factory/build-resources/.github/workflows/add-labels-to-issue.yaml@v3

  slack-notification:
    needs: [add-issue-labels]
    if: ${{ always() && contains(fromJSON('["failure", "cancelled"]'), needs.add-issue-labels.outputs.job-status) }}
    secrets:
      SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
    uses: senzing-factory/build-resources/.github/workflows/build-failure-slack-notification.yaml@v3
    with:
      job-status: ${{ needs.add-issue-labels.outputs.job-status }}
