Skip to content

Commit

Permalink
ci: zip patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeis committed Nov 9, 2024
1 parent a94ad62 commit 75c3d7e
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/zip-patterns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Zip Patterns Folder and Commit

on:
push:
branches:
- main
paths:
- 'patterns/**'

permissions:
contents: write # Ensure the workflow has write permissions

jobs:
zip-and-commit:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Zip patterns folder
run: |
zip -r patterns.zip patterns
- name: Check if zip file has changed
id: check_changes
run: |
git add patterns.zip
if git diff --cached --quiet; then
echo "No changes to commit."
echo "changed=false" >> $GITHUB_ENV
else
echo "Changes detected."
echo "changed=true" >> $GITHUB_ENV
- name: Commit and push changes
if: env.changed == 'true'
run: |
git commit -m "Update patterns.zip"
git push origin main

0 comments on commit 75c3d7e

Please sign in to comment.