Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .github/workflows/leaves_pr.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/serverless_pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Serverless PR
on:
pull_request:
branches:
- master

env:
LOG_ROOT: "log"

jobs:
changes:
runs-on: ubuntu-latest
name: Serverless PR handler
outputs:
# Add extra outputs here to match any additions to the matched patterns in the filter step below.
log: ${{ steps.filter.outputs.log }}
pending: ${{ steps.filter.outputs.pending }}
steps:
- name: Check for log structure PRs
id: filter
uses: dorny/paths-filter@v2
with:
list-files: shell
filters: |
log:
- '${{ env.LOG_ROOT }}/**'
pending:
- added: '${{ env.LOG_ROOT }}/leaves/pending/*'

- name: Detect log structure changes
if: steps.filter.outputs.log == 'true' && steps.filter.outputs.pending == 'false'
run: |
for i in ${{ steps.filter.outputs.log_files }}; do
echo "::error file=${i}::Modified protected log structure - ensure additions are placed in the ${{ env.LOG_ROOT }}/leaves/pending directory"
done
exit 1

# Run this job only when we've detected pending leaf additions
leaf_validator_job:
needs: changes
if: ${{ needs.changes.outputs.pending == 'true' }}
runs-on: ubuntu-latest
name: Validate pending leaves
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Leaf validator step
id: leaf_validator
uses: google/trillian-examples/serverless/deploy/github/leaf_validator@HEAD
with:
log_dir: '${{ env.LOG_ROOT }}'

8 changes: 8 additions & 0 deletions log/bananas
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Test serverless log repo

This repo is a test instance for the [serverless log & GitHub actions](https://github.com/google/trillian-examples/tree/master/serverless).

For the curious, it's a transparency log stored in the form of static files,
and is being automatically updated with a GitHub Action from the above repo.