| 1 |
--- |
| 2 |
name: Compliance |
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [main] |
| 6 |
pull_request: |
| 7 |
branches: [main] |
| 8 |
merge_group: |
| 9 |
types: [checks_requested] |
| 10 |
branches: [main] |
| 11 |
|
| 12 |
permissions: |
| 13 |
contents: read |
| 14 |
id-token: write |
| 15 |
statuses: write |
| 16 |
|
| 17 |
jobs: |
| 18 |
duvet: |
| 19 |
runs-on: ubuntu-latest |
| 20 |
steps: |
| 21 |
- name: Clone s2n-tls |
| 22 |
uses: actions/checkout@v7 |
| 23 |
|
| 24 |
- name: Run duvet action |
| 25 |
uses: awslabs/duvet-action@v1 |
| 26 |
with: |
| 27 |
duvet-version: 0.3.0 |
| 28 |
report-script: compliance/generate_report.sh |
| 29 |
role-to-assume: arn:aws:iam::024603541914:role/GitHubOIDCRole |
| 30 |
role-session-name: S2ntlsGHAS3Session |
| 31 |
aws-s3-bucket-name: s2n-tls-ci-artifacts |
| 32 |
aws-s3-region: us-west-2 |
| 33 |
cdn: https://d3fqnyekunr9xg.cloudfront.net |
| 34 |
|
| 35 |
- name: Extract RFC spec data |
| 36 |
working-directory: ./compliance |
| 37 |
run: ./initialize_duvet.sh |
| 38 |
shell: bash |
| 39 |
|
| 40 |
- name: Check if there are uncommitted changes |
| 41 |
run: | |
| 42 |
# If this fails you need to run `cd compliance && ./compliance/initialize_duvet.sh` |
| 43 |
# |
| 44 |
# Use 'git status --porcelain' instead of 'git diff --exit-code' since git diff |
| 45 |
# only detects diffs but fails to detect new files. |
| 46 |
git_status=$(git status --porcelain) |
| 47 |
if [ -n "$git_status" ]; then |
| 48 |
echo "Found uncommitted changes:" |
| 49 |
echo "$git_status" |
| 50 |
exit 1 |
| 51 |
else |
| 52 |
echo "Workspace is clean" |
| 53 |
fi |
| 54 |
shell: bash |