Skip to content
Merged
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
28 changes: 13 additions & 15 deletions .github/workflows/vendored-file-warning.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
name: vendored-file-warning

on:
pull_request_target:
pull_request:
paths:
- "crates/aqua-registry/aqua-registry/**"

permissions: {}

jobs:
warn:
if: github.actor != 'jdx' && github.actor != 'mise-en-dev'
if: github.event.pull_request.user.login != 'jdx' && github.event.pull_request.user.login != 'mise-en-dev'
runs-on: ubuntu-latest
steps:
- name: Comment on PR
env:
GH_TOKEN: ${{ secrets.MISE_PR_COMMENT_TOKEN }}
- name: Fail on vendored file changes
run: |
existing=$(gh pr view "${{ github.event.pull_request.number }}" \
-R "${{ github.repository }}" \
--json comments --jq '.comments[].body' \
| grep -c "vendored from the upstream" || true)
if [ "$existing" = "0" ]; then
gh pr comment "${{ github.event.pull_request.number }}" \
-R "${{ github.repository }}" \
--body "The aqua registry files under \`crates/aqua-registry/aqua-registry/\` are vendored from the upstream [aqua-registry](https://github.com/aquaproj/aqua-registry) and should not be modified directly in this repo. Please submit package definition changes to the upstream aqua-registry instead, and they will be picked up here when we next update the vendored copy.
cat <<'EOF'
The aqua registry files under `crates/aqua-registry/aqua-registry/` are vendored
from the upstream aqua-registry (https://github.com/aquaproj/aqua-registry) and
should not be modified directly in this repo. Please submit package definition
changes to the upstream aqua-registry instead, and they will be picked up here
when we next update the vendored copy.

The \`registry/*.toml\` files are fine to add here, but the backend should reference the package after it's been accepted upstream."
fi
The `registry/*.toml` files are fine to add here, but the backend should
reference the package after it's been accepted upstream.
EOF
exit 1
Loading