Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/real-pears-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"validate-protos-version": major
---

initial release
3 changes: 3 additions & 0 deletions actions/validate-protos-version/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# validate-protos-version

>
58 changes: 58 additions & 0 deletions actions/validate-protos-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: validate-protos-version
description: >
Validates that all github.com/smartcontractkit/chainlink-protos/cre/go
pseudo-versions in go.mod files reference commits from the
capabilities-development branch of chainlink-protos.

runs:
using: composite
steps:
- name: Checkout chainlink-protos
uses: actions/checkout@v6
with:
repository: smartcontractkit/chainlink-protos
ref: capabilities-development
path: .chainlink-protos
fetch-depth: 0
persist-credentials: false

- name:
Validate chainlink-protos/cre/go versions are from
capabilities-development
shell: bash
run: |
failed=0
found=0

while IFS= read -r gomod; do
version=$(grep 'github.com/smartcontractkit/chainlink-protos/cre/go ' "$gomod" | head -1 | awk '{print $2}' || true)
if [[ -z "$version" ]]; then
continue
fi

found=1
commit=${version##*-}

echo "Checking $gomod: version=$version commit=$commit"

if ! git -C .chainlink-protos merge-base --is-ancestor "$commit" capabilities-development 2>/dev/null; then
echo "::error file=$gomod::commit $commit is NOT on the capabilities-development branch of chainlink-protos"
failed=1
else
echo "OK: commit $commit is on capabilities-development"
fi
done < <(find . -name go.mod -not -path './proto_vendor/*' -not -path './.chainlink-protos/*')

if [[ "$found" -eq 0 ]]; then
echo "::error::No go.mod files found containing chainlink-protos/cre/go"
exit 1
fi

if [[ "$failed" -eq 1 ]]; then
echo ""
echo "One or more go.mod files reference a chainlink-protos/cre/go commit that is not on the capabilities-development branch."
exit 1
fi

echo ""
echo "All chainlink-protos/cre/go versions are from capabilities-development."
11 changes: 11 additions & 0 deletions actions/validate-protos-version/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "validate-protos-version",
"version": "0.0.0",
"description": "",
"private": true,
"scripts": {},
"author": "@smartcontractkit",
"license": "MIT",
"dependencies": {},
"repository": "https://github.com/smartcontractkit/.github"
}
8 changes: 8 additions & 0 deletions actions/validate-protos-version/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "validate-protos-version",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "actions/validate-protos-version",
"// targets": "to see all targets run: nx show project validate-protos-version --web",
"targets": {}
}
Loading