mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-09 01:09:16 +00:00
Compare commits
1 Commits
3b54b4c513
...
74c9684bba
Author | SHA1 | Date | |
---|---|---|---|
|
74c9684bba |
@ -34,8 +34,8 @@ jobs:
|
|||||||
# Step 4: Run the generate-app-headers.sh script to update .app-headers
|
# Step 4: Run the generate-app-headers.sh script to update .app-headers
|
||||||
- name: Run generate-app-headers.sh to update .app-headers
|
- name: Run generate-app-headers.sh to update .app-headers
|
||||||
run: |
|
run: |
|
||||||
chmod +x .github/workflows/scripts/generate-app-headers.sh
|
chmod +x .github/workflows/generate-app-headers.sh
|
||||||
.github/workflows/scripts/generate-app-headers.sh
|
.github/workflows/generate-app-headers.sh
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
name: Update date_created in JSON files
|
|
||||||
|
|
||||||
on:
|
|
||||||
# Dieser Trigger wird für das Öffnen von PRs sowie für das Aktualisieren von offenen PRs verwendet
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize]
|
|
||||||
schedule:
|
|
||||||
# Dieser Trigger wird 4x am Tag ausgelöst, um sicherzustellen, dass das Datum aktualisiert wird
|
|
||||||
- cron: "0 0,6,12,18 * * *" # Führt alle 6 Stunden aus
|
|
||||||
workflow_dispatch: # Manuelle Ausführung des Workflows möglich
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-date:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install yq
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y yq
|
|
||||||
|
|
||||||
- name: Set the current date
|
|
||||||
id: set_date
|
|
||||||
run: echo "TODAY=$(date -u +%Y-%m-%d)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Check for changes in PR
|
|
||||||
run: |
|
|
||||||
# Hole den PR-Branch
|
|
||||||
PR_BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
|
|
||||||
git fetch origin $PR_BRANCH
|
|
||||||
|
|
||||||
# Liste alle JSON-Dateien im PR auf, die geändert wurden
|
|
||||||
CHANGED_JSON_FILES=$(git diff --name-only origin/main...$PR_BRANCH | grep '.json')
|
|
||||||
|
|
||||||
if [ -z "$CHANGED_JSON_FILES" ]; then
|
|
||||||
echo "No JSON files changed in this PR."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Gehe alle geänderten JSON-Dateien durch und aktualisiere das Datum
|
|
||||||
for file in $CHANGED_JSON_FILES; do
|
|
||||||
echo "Updating date_created in $file"
|
|
||||||
# Setze das aktuelle Datum
|
|
||||||
yq eval ".date_created = \"${{ env.TODAY }}\"" -i "$file"
|
|
||||||
git add "$file"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Commit and push changes
|
|
||||||
run: |
|
|
||||||
# Prüfe, ob es Änderungen gibt und committe sie
|
|
||||||
git config user.name "json-updater-bot"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
|
|
||||||
git commit -m "Update date_created to ${{ env.TODAY }}" || echo "No changes to commit"
|
|
||||||
|
|
||||||
# Push zurück in den PR-Branch
|
|
||||||
git push origin $PR_BRANCH
|
|
32
.github/workflows/check_and_update_json_date.yml
vendored
Normal file
32
.github/workflows/check_and_update_json_date.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
name: Update Date Created in PR
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '*.json'
|
||||||
|
types: [opened, synchronize]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-date:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout PR branch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.head_ref }}
|
||||||
|
|
||||||
|
- name: Install yq
|
||||||
|
run: |
|
||||||
|
curl -sSL https://github.com/mikefarah/yq/releases/download/v4.18.1/yq_linux_amd64 -o /usr/local/bin/yq
|
||||||
|
chmod +x /usr/local/bin/yq
|
||||||
|
|
||||||
|
- name: Update date_created in JSON
|
||||||
|
run: |
|
||||||
|
TODAY=$(date -u +%Y-%m-%d)
|
||||||
|
yq e '.date_created = strftime("%Y-%m-%d")' -i your_file.json
|
||||||
|
|
||||||
|
- name: Commit changes if necessary
|
||||||
|
run: |
|
||||||
|
git status
|
||||||
|
git diff --quiet || (git commit -m "Update date_created to $TODAY" && git push origin ${{ github.head_ref }})
|
23
.github/workflows/scripts/update_json_date.sh
vendored
23
.github/workflows/scripts/update_json_date.sh
vendored
@ -1,23 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Verzeichnis, das die JSON-Dateien enthält
|
|
||||||
json_dir="./json/*.json"
|
|
||||||
|
|
||||||
current_date=$(date +"%Y-%m-%d")
|
|
||||||
|
|
||||||
for json_file in $json_dir; do
|
|
||||||
if [[ -f "$json_file" ]]; then
|
|
||||||
current_json_date=$(jq -r '.date_created' "$json_file")
|
|
||||||
|
|
||||||
if [[ "$current_json_date" != "$current_date" ]]; then
|
|
||||||
echo "Updating $json_file with date $current_date"
|
|
||||||
jq --arg date "$current_date" '.date_created = $date' "$json_file" > temp.json && mv temp.json "$json_file"
|
|
||||||
|
|
||||||
git add "$json_file"
|
|
||||||
git commit -m "Update date_created to $current_date in $json_file"
|
|
||||||
else
|
|
||||||
echo "Date in $json_file is already up to date."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
git push origin HEAD
|
|
68
.github/workflows/update_json_date.yml
vendored
68
.github/workflows/update_json_date.yml
vendored
@ -1,68 +0,0 @@
|
|||||||
name: Update JSON Date in PR
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- synchronize
|
|
||||||
- reopened
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update_json:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Configure Git user
|
|
||||||
run: |
|
|
||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --global user.name "github-actions[bot]"
|
|
||||||
|
|
||||||
- name: Get list of changed files in PR
|
|
||||||
id: files
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const prNumber = context.payload.pull_request.number;
|
|
||||||
const prFiles = await github.rest.pulls.listFiles({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: prNumber,
|
|
||||||
});
|
|
||||||
|
|
||||||
// Filter for JSON files only
|
|
||||||
const changedJsonFiles = prFiles.data
|
|
||||||
.filter(file => file.filename.endsWith('.json'))
|
|
||||||
.map(file => file.filename);
|
|
||||||
|
|
||||||
core.setOutput('changed_files', changedJsonFiles.join('\n'));
|
|
||||||
console.log('Changed JSON files:', changedJsonFiles);
|
|
||||||
|
|
||||||
- name: Update dates in changed JSON files
|
|
||||||
run: |
|
|
||||||
changed_files="${{ steps.files.outputs.changed_files }}"
|
|
||||||
if [[ -z "$changed_files" ]]; then
|
|
||||||
echo "No JSON files changed in this PR. Exiting."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
for file in $changed_files; do
|
|
||||||
echo "Updating $file with current date."
|
|
||||||
# Your logic to update the file
|
|
||||||
jq '.date_created = "'"$(date +%Y-%m-%d)"'"' "$file" > tmp.$$.json && mv tmp.$$.json "$file"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Commit changes if updated
|
|
||||||
run: |
|
|
||||||
git add *.json
|
|
||||||
git diff --cached --quiet || git commit -m "Update JSON dates"
|
|
||||||
|
|
||||||
- name: Push changes
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
git push
|
|
@ -24,10 +24,6 @@ Do not break established syntax in this file, as it is automatically updated by
|
|||||||
|
|
||||||
- Fix: Add FFMPEG for OpenWebUI [@MickLesk](https://github.com/MickLesk) ([#1497](https://github.com/community-scripts/ProxmoxVE/pull/1497))
|
- Fix: Add FFMPEG for OpenWebUI [@MickLesk](https://github.com/MickLesk) ([#1497](https://github.com/community-scripts/ProxmoxVE/pull/1497))
|
||||||
|
|
||||||
### 🧰 Maintenance
|
|
||||||
|
|
||||||
- [core] build.func&install.func: Fix ssh keynot added error [@dsiebel](https://github.com/dsiebel) ([#1502](https://github.com/community-scripts/ProxmoxVE/pull/1502))
|
|
||||||
|
|
||||||
## 2025-01-14
|
## 2025-01-14
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -827,7 +827,6 @@ build_container() {
|
|||||||
export PASSWORD="$PW"
|
export PASSWORD="$PW"
|
||||||
export VERBOSE="$VERB"
|
export VERBOSE="$VERB"
|
||||||
export SSH_ROOT="${SSH}"
|
export SSH_ROOT="${SSH}"
|
||||||
export SSH_AUTHORIZED_KEY
|
|
||||||
export CTID="$CT_ID"
|
export CTID="$CT_ID"
|
||||||
export CTTYPE="$CT_TYPE"
|
export CTTYPE="$CT_TYPE"
|
||||||
export PCT_OSTYPE="$var_os"
|
export PCT_OSTYPE="$var_os"
|
||||||
|
@ -255,11 +255,4 @@ EOF
|
|||||||
fi
|
fi
|
||||||
echo "bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/${app}.sh)\"" >/usr/bin/update
|
echo "bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/${app}.sh)\"" >/usr/bin/update
|
||||||
chmod +x /usr/bin/update
|
chmod +x /usr/bin/update
|
||||||
|
|
||||||
if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then
|
|
||||||
mkdir -p /root/.ssh
|
|
||||||
echo "${SSH_AUTHORIZED_KEY}" > /root/.ssh/authorized_keys
|
|
||||||
chmod 700 /root/.ssh
|
|
||||||
chmod 600 /root/.ssh/authorized_keys
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user