validate and upload on PRs #781
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
on: | |
pull_request: | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
check_packs: | |
name: check packs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
files.pythonhosted.org:443 | |
github.com:443 | |
pypi.org:443 | |
- name: Checkout panther-analysis | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 | |
- name: Set python version | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0 | |
with: | |
python-version: "3.11" | |
- name: Install panther_analysis_tool | |
run: pip install panther_analysis_tool | |
- name: Check packs | |
continue-on-error: true | |
id: check-packs | |
run: | | |
panther_analysis_tool check-packs 2> errors.txt || true | |
# run again to get exit code | |
panther_analysis_tool check-packs || echo "errors=`cat errors.txt`" >> $GITHUB_OUTPUT | |
- name: Comment PR | |
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 | |
if: ${{ steps.check-packs.outputs.errors }} | |
with: | |
mode: upsert | |
message: | | |
:scream: | |
looks like some things could be wrong with the packs | |
```diff | |
${{ steps.check-packs.outputs.errors }} | |
``` | |
comment_tag: check-packs | |
- name: Delete comment | |
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 | |
if: ${{ !steps.check-packs.outputs.errors }} | |
with: | |
mode: delete | |
message: | | |
:scream: | |
looks like some things could be wrong with the packs | |
```diff | |
${{ steps.check-packs.outputs.errors }} | |
``` | |
comment_tag: check-packs |