Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action to detect edits to ignored prototypes #842

Closed
Closed
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
38 changes: 38 additions & 0 deletions .github/workflows/check-ignored-prototype.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "No ignored prototype edits"

on:
pull_request_target:

jobs:
verify-ignored:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- name: Read ignored prototypes
uses: pietrobolcato/[email protected]
id: ignored_protos
with:
config: ${{ github.workspace }}/Resources/IgnoredPrototypes/ignoredPrototypes.yml

- name: Get changed files
id: files
uses: Ana06/[email protected]
with:
format: 'space-delimited'

- name: Check for ignored prototypes
run: |
CHANGED_FILES="${{ steps.files.outputs.files }}"
IGNORED_PROTOS="${{ steps.ignored_protos.outputs }}"

for FILE in $CHANGED_FILES; do
# Remove the "/Resources/" prefix if present
FILE="${FILE/\/Resources\//}"

if echo "$IGNORED_PROTOS" | grep -q "$FILE"; then
echo "Error: This pull request contains changes to ignored prototype: $FILE"
exit 1
fi
done
5 changes: 3 additions & 2 deletions Resources/IgnoredPrototypes/ignoredPrototypes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@

# e.g., you can specify both directories and specific files by adding lines like:
#
# - /Prototypes/Guidebook
# - /Prototypes/Catalog/uplink_catalog.yml
- /Prototypes/Guidebook
- /Prototypes/Catalog/uplink_catalog.yml

4 changes: 3 additions & 1 deletion Resources/Prototypes/Catalog/uplink_catalog.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# TODO: make more categories
# Guns

# You should ignore me too!

- type: listing
id: UplinkPistolViper
name: uplink-pistol-viper-name
Expand Down Expand Up @@ -525,7 +527,7 @@
description: uplink-binary-translator-key-desc
icon: { sprite: /Textures/Objects/Devices/encryption_keys.rsi, state: rd_label }
productEntity: EncryptionKeyBinary
cost:
cost:
Telecrystal: 1

categories:
Expand Down
2 changes: 2 additions & 0 deletions Resources/Prototypes/Guidebook/botany.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
id: Botany
name: guide-entry-botany
text: "/ServerInfo/Guidebook/Service/Botany.xml"

# Ignore me!
2 changes: 1 addition & 1 deletion Resources/Prototypes/Guidebook/science.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
name: guide-entry-technologies
text: "/ServerInfo/Guidebook/Science/Technologies.xml"
filterEnabled: True

# Ignore me too!
- type: guideEntry
id: AnomalousResearch
name: guide-entry-anomalous-research
Expand Down
Loading