mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-01-10 06:48:04 -05:00
## CHANGES - Upgrade GitHub Actions to latest versions (v6, v21) - Add modernization check step in CI workflow - Replace strings manipulation with `strings.CutPrefix` and `strings.CutSuffix` - Replace manual loops with `slices.Contains` for validation - Use `strings.SplitSeq` for iterator-based string splitting - Replace `bytes.TrimPrefix` with `bytes.CutPrefix` for clarity - Use `strings.Builder` instead of string concatenation - Replace `fmt.Sprintf` with `fmt.Appendf` for efficiency - Simplify padding calculation with `max` builtin
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
name: Patterns Artifact
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- "data/patterns/**" # Trigger only on changes to files in the patterns folder
|
|
|
|
jobs:
|
|
zip-and-upload:
|
|
name: Zip and Upload Patterns Folder
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Verify Changes in Patterns Folder
|
|
id: check-changes
|
|
run: |
|
|
git fetch origin
|
|
if git diff --quiet HEAD~1 -- data/patterns; then
|
|
echo "No changes detected in patterns folder."
|
|
echo "changes=false" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "Changes detected in patterns folder."
|
|
echo "changes=true" >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Zip the Patterns Folder
|
|
if: steps.check-changes.outputs.changes == 'true'
|
|
run: zip -r patterns.zip data/patterns/
|
|
|
|
- name: Upload Patterns Artifact
|
|
if: steps.check-changes.outputs.changes == 'true'
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: patterns
|
|
path: patterns.zip
|