Skip to content

Commit

Permalink
kernelCTF: GHA: artifact backup: folder structure fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
koczkatamas committed Nov 11, 2023
1 parent 321bd54 commit 431fb3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/kernelctf-submission-verification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jobs:
- name: Upload repro summary as an artifact
uses: actions/upload-artifact@v3
with:
name: repro_summary_${{ env.RELEASE_ID }}.txt
name: repro_summary_${{ env.RELEASE_ID }}
path: ./kernelctf/repro/repro_summary.md

backup_artifacts:
Expand All @@ -244,5 +244,7 @@ jobs:
uses: 'google-github-actions/upload-cloud-storage@v1'
with:
path: ./artifacts
destination: kernelctf-build/artifacts/${{ needs.structure_check.outputs.artifact_backup_dir }}
destination: kernelctf-build/artifacts/${{ needs.structure_check.outputs.artifact_backup_dir }}_${{ github.run_id }}
parent: false
predefinedAcl: publicRead
process_gcloudignore: false # removes warnings that .gcloudignore file does not exist
5 changes: 3 additions & 2 deletions kernelctf/check-submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import json
import jsonschema
import hashlib
from datetime import datetime
from utils import *

PUBLIC_CSV_URL = "https://docs.google.com/spreadsheets/d/e/2PACX-1vS1REdTA29OJftst8xN5B5x8iIUcxuK6bXdzF8G1UXCmRtoNsoQ9MbebdRdFnj6qZ0Yd7LwQfvYC2oF/pub?output=csv"
Expand Down Expand Up @@ -82,6 +81,7 @@
submissionIds = metadata.get("submission_ids", None) or metadata["submission_id"]
if isinstance(submissionIds, str):
submissionIds = [submissionIds]
submissionIds.sort()
print(f"[-] Submission IDs = {submissionIds}")

publicCsv = fetch(PUBLIC_CSV_URL, "public.csv")
Expand All @@ -92,6 +92,7 @@
fail(f"submission ID ({submissionId}) was not found on public spreadsheet")

submissionIds = list(set(submissionIds).intersection(publicSheet.keys()))
submissionIds.sort()

flags = []
for submissionId in submissionIds:
Expand Down Expand Up @@ -149,7 +150,7 @@ def summary(success, text):
if not exploit_info: continue
exploits_info[target] = { key: exploit_info[key] for key in ["uses", "requires_separate_kaslr_leak"] if key in exploit_info }
ghSet("OUTPUT", f"exploits_info={json.dumps(exploits_info)}")
ghSet("OUTPUT", f"artifact_backup_dir={'_'.join(submissionIds)}_{datetime.utcnow().strftime('%Y%m%d_%H%M%S')}")
ghSet("OUTPUT", f"artifact_backup_dir={'_'.join(submissionIds)}")

summary(True, f"✅ The file structure verification of the PR was successful!")

0 comments on commit 431fb3c

Please sign in to comment.