Create encrypted rule package #3
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
name: Create encrypted rule package | |
on: | |
workflow_dispatch: | |
jobs: | |
zip-and-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
repository: 'Yamato-Security/hayabusa-rules' | |
- name: Extract directory | |
run: | | |
mkdir extracted | |
cp -r ./config ./extracted | |
cp -r ./hayabusa ./extracted | |
cp -r ./sigma ./extracted | |
- name: Zip directory | |
run: | | |
sudo apt-get install zip | |
zip -r -P yamato-security-hayabusa encrypted-hayabusa-rules.zip ./extracted | |
- name: Checkout self repository | |
uses: actions/checkout@v4 | |
with: | |
path: './self' | |
- name: Copy zip to self repository | |
run: | | |
cp ./encrypted-hayabusa-rules.zip ./self | |
- name: Commit and push if changes | |
run: | | |
cd ./self | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add -A | |
if git diff-index --quiet HEAD --; then | |
echo "No changes to commit" | |
else | |
git commit -m "Add updated encrypted-hayabusa-rules.zip" | |
git push |