Skip to content

Commit

Permalink
Merge branch 'traduzioni' into try-action
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-calabrese authored Oct 11, 2024
2 parents c5777fe + 165ca64 commit 833546e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/show_edited_folders.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Identify Modified Docs Subfolders

on:
pull_request:
branches:
- traduzioni
types: [opened, synchronize]

jobs:
check-modified-subfolders:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: Get list of modified files in docs
id: modified_files
run: |
# Get list of modified or added files within the docs folder
MODIFIED_FILES=$(git diff --name-only origin/traduzioni HEAD | grep '^docs/' || echo "")
echo "Modified files: $MODIFIED_FILES"
# Extract subfolders from the list of modified files
MODIFIED_SUBFOLDERS=$(echo "$MODIFIED_FILES" | awk -F'/' '{print $1"/"$2}' | sort -u)
echo "Modified subfolders: $MODIFIED_SUBFOLDERS"
# Set output variable
echo "subfolders=$MODIFIED_SUBFOLDERS" >> $GITHUB_OUTPUT
- name: Post comment on PR with modified subfolders
if: steps.modified_files.outputs.subfolders != ''
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
with:
message: |
### Modified subfolders in 'docs':
${{ steps.modified_files.outputs.subfolders }}

0 comments on commit 833546e

Please sign in to comment.