-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: validate source changes in PRs (#113)
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
let | ||
sourceFile = ../_sources/generated.json; | ||
sources = builtins.fromJSON (builtins.readFile sourceFile); | ||
isFromOrg = v: v.src.owner == "catppuccin"; | ||
badSources = builtins.filter (src: !(isFromOrg src)) (builtins.attrValues sources); | ||
in | ||
# error if any sources are found that don't originate | ||
# from the catppuccin org | ||
if ((builtins.length badSources) == 0) | ||
then "GOOD" | ||
else builtins.throw "BAD" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Validate sources | ||
# Per CONTRIBUTING.md, we do not accept unofficial ports. This enforces | ||
# that policy and ensures all sources are only from the official GitHub org | ||
|
||
on: | ||
push: | ||
paths: | ||
- '_sources/**' | ||
- 'nvfetcher.toml' | ||
pull_request: | ||
paths: | ||
- '_sources/**' | ||
- 'nvfetcher.toml' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check: | ||
name: Check for external repositories | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Nix | ||
uses: cachix/install-nix-action@v26 | ||
|
||
- name: Run check | ||
run: | | ||
set -e | ||
nix eval --file ./.github/checkSources.nix |