pantry/.github/workflows/complain.yml

65 lines
1.9 KiB
YAML
Raw Normal View History

name: complain
on:
workflow_call:
inputs:
projects:
required: true
type: string
platform:
required: true
type: string
permissions:
issues: write
jobs:
complain:
runs-on: ubuntu-latest
steps:
2023-03-31 00:26:54 +03:00
- name: Find issue
uses: actions-cool/issues-helper@v3
id: find
with:
actions: 'find-issues'
token: ${{ secrets.GITHUB_TOKEN }}
issue-state: 'open'
2023-03-31 00:31:32 +03:00
title-includes: "❌ build issues: ${{ inputs.projects }}"
2023-03-31 00:26:54 +03:00
labels: 'build-failure'
2023-03-31 00:26:54 +03:00
- name: Create issue
uses: actions-cool/issues-helper@v3
id: create
if: ${{ steps.find.outputs.issues == '[]' }}
with:
2023-03-31 00:26:54 +03:00
actions: 'create-issue'
token: ${{ secrets.GITHUB_TOKEN }}
2023-03-31 00:31:32 +03:00
title: "❌ build issues: ${{ inputs.projects }}"
body: "Running log of build failures for ${{ inputs.projects }}"
2023-03-31 00:26:54 +03:00
labels: 'build-failure'
assignees: 'jhheider'
- name: Log comment
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ steps.create.outputs.issue-number || fromJSON(steps.find.outputs.issues)[0].number }}
body: |
# Build failure
2023-03-31 00:31:32 +03:00
## ${{ inputs.projects }}
2023-03-31 00:26:54 +03:00
### ${{ inputs.platform }}
logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
2023-03-26 03:35:56 +03:00
- uses: martialonline/workflow-status@v3
id: status
- uses: rtCamp/action-slack-notify@v2
if: ${{ env.SLACK_WEBHOOK != '' }}
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_MESSAGE: new-version:${{ inputs.projects }} (${{ inputs.platform }}) ${{ steps.status.outputs.status }}
SLACK_COLOR: ${{ steps.status.outputs.status }}