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

Only modify changed or added files - not deleted ones #967

Merged
merged 1 commit into from
Jul 6, 2020
Merged
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
Only modify changed or added files - not deleted ones
  • Loading branch information
tunetheweb committed Jul 6, 2020
commit c759c385c661829f1d2454e4c2eff5826a975700
14 changes: 7 additions & 7 deletions .github/workflows/generate_chapters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
echo "files changed in commit $COMMIT_SHA:"
git diff-tree --no-commit-id --name-only -r $COMMIT_SHA
echo "Incrementing any references to changed CSS files"
git diff-tree --no-commit-id --name-only -r $COMMIT_SHA src/static/css | grep "\.css" | sed 's!.*/!!' | sed "s/\(.*\)/s\/\1?v=[0-9][0-9]*\/\1?v=$(date +%Y%m%d%H%M%S)\//" | sed -f - -i src/templates/base/*/*.html
git diff-tree --no-commit-id --name-only -r $COMMIT_SHA src/static/css | grep "\.css" | sed 's!.*/!!' | sed "s/\(.*\)/s\/\1?v=[0-9][0-9]*\/\1?v=$(date +%Y%m%d%H%M%S)\//" | sed -f - -i src/templates/base.html
git diff-tree --diff-filter=AM --no-commit-id --name-only -r $COMMIT_SHA src/static/css | grep "\.css" | sed 's!.*/!!' | sed "s/\(.*\)/s\/\1?v=[0-9][0-9]*\/\1?v=$(date +%Y%m%d%H%M%S)\//" | sed -f - -i src/templates/base/*/*.html
git diff-tree --diff-filter=AM --no-commit-id --name-only -r $COMMIT_SHA src/static/css | grep "\.css" | sed 's!.*/!!' | sed "s/\(.*\)/s\/\1?v=[0-9][0-9]*\/\1?v=$(date +%Y%m%d%H%M%S)\//" | sed -f - -i src/templates/base.html
git diff
- name: Update JS version for modified CSS files
env:
Expand All @@ -47,8 +47,8 @@ jobs:
echo "files changed in commit $COMMIT_SHA:"
git diff-tree --no-commit-id --name-only -r $COMMIT_SHA
echo "Incrementing any references to changed JS files"
git diff-tree --no-commit-id --name-only -r $COMMIT_SHA src/static/js | grep "\.js" | sed 's!.*/!!' | sed "s/\(.*\)/s\/\1?v=[0-9][0-9]*\/\1?v=$(date +%Y%m%d%H%M%S)\//" | sed -f - -i src/templates/base/*/*.html
git diff-tree --no-commit-id --name-only -r $COMMIT_SHA src/static/js | grep "\.js" | sed 's!.*/!!' | sed "s/\(.*\)/s\/\1?v=[0-9][0-9]*\/\1?v=$(date +%Y%m%d%H%M%S)\//" | sed -f - -i src/templates/base.html
git diff-tree --diff-filter=AM --no-commit-id --name-only -r $COMMIT_SHA src/static/js | grep "\.js" | sed 's!.*/!!' | sed "s/\(.*\)/s\/\1?v=[0-9][0-9]*\/\1?v=$(date +%Y%m%d%H%M%S)\//" | sed -f - -i src/templates/base/*/*.html
git diff-tree --diff-filter=AM --no-commit-id --name-only -r $COMMIT_SHA src/static/js | grep "\.js" | sed 's!.*/!!' | sed "s/\(.*\)/s\/\1?v=[0-9][0-9]*\/\1?v=$(date +%Y%m%d%H%M%S)\//" | sed -f - -i src/templates/base.html
git diff
- name: Update timestamp for modified files
env:
Expand All @@ -57,10 +57,10 @@ jobs:
echo "files changed in commit $COMMIT_SHA:"
git diff-tree --no-commit-id --name-only -r $COMMIT_SHA
echo "Updating timestamp in any markdown chapter files"
git diff-tree --no-commit-id --name-only -r $COMMIT_SHA src/content | grep "^src\/content\/[a-z]*\/[0-9]*\/[a-z0-9-]*.md" | xargs -r sed -i "s/^last_updated: [0-9-]*T/last_updated: $(date '+%Y-%m-%d')T/"
git diff-tree --diff-filter=AM --no-commit-id --name-only -r $COMMIT_SHA src/content | grep "^src\/content\/[a-z]*\/[0-9]*\/[a-z0-9-]*.md" | xargs -r sed -i "s/^last_updated: [0-9-]*T/last_updated: $(date '+%Y-%m-%d')T/"
echo "Updating timestamp in any template files"
git diff-tree --no-commit-id --name-only -r $COMMIT_SHA src/templates | grep "^src\/templates\/[a-z][a-z]\/20[0-9][0-9]\/[a-zA-Z0-9_]*.html" | xargs -r sed -i "s/{% block date_modified %}[0-9-]*T/{% block date_modified %}$(date '+%Y-%m-%d')T/"
git diff-tree --no-commit-id --name-only -r $COMMIT_SHA src/templates | grep "^src\/templates\/[a-z][a-z]\/[a-zA-Z0-9_]*.html" | xargs -r sed -i "s/{% block date_modified %}[0-9-]*T/{% block date_modified %}$(date '+%Y-%m-%d')T/"
git diff-tree --diff-filter=AM --no-commit-id --name-only -r $COMMIT_SHA src/templates | grep "^src\/templates\/[a-z][a-z]\/20[0-9][0-9]\/[a-zA-Z0-9_]*.html" | xargs -r sed -i "s/{% block date_modified %}[0-9-]*T/{% block date_modified %}$(date '+%Y-%m-%d')T/"
git diff-tree --diff-filter=AM --no-commit-id --name-only -r $COMMIT_SHA src/templates | grep "^src\/templates\/[a-z][a-z]\/[a-zA-Z0-9_]*.html" | xargs -r sed -i "s/{% block date_modified %}[0-9-]*T/{% block date_modified %}$(date '+%Y-%m-%d')T/"
echo "Updated timestamps:"
git diff
- name: Setup Node.js for use with actions
Expand Down