mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-15 04:09:19 +00:00
Update update_json_date.yml
This commit is contained in:
parent
cdbabcac89
commit
f03471133e
12
.github/workflows/update_json_date.yml
vendored
12
.github/workflows/update_json_date.yml
vendored
@ -24,16 +24,24 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 2 # Ensure we have at least the last commit for comparison
|
||||||
|
|
||||||
- name: Set up Git
|
- name: Set up Git
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "GitHub Actions"
|
git config --global user.name "GitHub Actions"
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
- name: Find newly added JSON files
|
- name: Find newly added JSON files (created today)
|
||||||
id: find_new_json
|
id: find_new_json
|
||||||
run: |
|
run: |
|
||||||
NEW_JSON_FILES=$(git diff --diff-filter=A --name-only HEAD~1 -- json/*.json || true)
|
TODAY=$(date -u +"%Y-%m-%d")
|
||||||
|
|
||||||
|
# Fetch latest main for proper diff
|
||||||
|
git fetch origin main --depth=1
|
||||||
|
|
||||||
|
# Find new JSON files added today
|
||||||
|
NEW_JSON_FILES=$(git log --since="$TODAY 00:00:00" --diff-filter=A --name-only --pretty=format: origin/main -- json/*.json || true)
|
||||||
|
|
||||||
if [[ -z "$NEW_JSON_FILES" ]]; then
|
if [[ -z "$NEW_JSON_FILES" ]]; then
|
||||||
echo "CHANGED=false" >> $GITHUB_ENV
|
echo "CHANGED=false" >> $GITHUB_ENV
|
||||||
|
Loading…
Reference in New Issue
Block a user