Skip to content

Commit

Permalink
fix(actions): update actions to include continue and notify
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtkeller committed Jul 8, 2024
1 parent 902e735 commit 79e76e3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/actions/notify-lula/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Notify Lula
description: "Comment on PR to notify Lula Team"

inputs:
state:
description: 'state of the comment update'
required: true
default: ''
flavor:
description: 'flavor of the comment update'
required: true
default: ''

runs:
using: composite
steps:
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Compliance ${{ inputs.flavor }} Evaluation

- name: Create comment
if: ${{ steps.fc.outputs.comment-id == '' && inputs.state == 'failure'}}
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Compliance ${{ inputs.flavor }} Evaluation: ${{ inputs.state }}
CC: @defenseunicorns/lula-dev
- name: Update comment

Check failure on line 35 in .github/actions/notify-lula/action.yaml

View workflow job for this annotation

GitHub Actions / lint-check

35:27 [trailing-spaces] trailing spaces
if: ${{ steps.fc.outputs.comment-id != '' }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
Compliance ${{ inputs.flavor }} Evaluation: ${{ inputs.state }}
CC: @defenseunicorns/lula-dev
11 changes: 11 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,19 @@ jobs:
run: uds run test-compliance-validate --no-progress

- name: Evaluate UDS Core Compliance
id: compliance-evaluation
if: ${{ inputs.package == 'all' && inputs.test_type == 'install' }}
run: uds run test-compliance-evaluate --no-progress
continue-on-error: true

# steps in this action only run when there has been a previous failure - will indicate success thereafter
# need to think about how much noise this could create - noise currently = good
- name: Notify Lula Team of Compliance Assessment Results
if: ${{ always() }}
uses: ./.github/actions/notify-lula
with:
state: ${{ steps.compliance-evaluation.conclusion }}
flavor: ${{ inputs.flavor }}

- name: Store UDS Core Compliance Assessment Results
if: ${{ inputs.package == 'all' && inputs.test_type == 'install' }}
Expand Down

0 comments on commit 79e76e3

Please sign in to comment.