mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-08 16:59:17 +00:00
Compare commits
3 Commits
7614034784
...
959a7b4b14
Author | SHA1 | Date | |
---|---|---|---|
|
959a7b4b14 | ||
|
5da06e75e7 | ||
|
2aed45fa61 |
53
.github/workflows/update_json_date.yml
vendored
53
.github/workflows/update_json_date.yml
vendored
@ -2,9 +2,12 @@ name: Update JSON Date in PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'json/*.json'
|
||||
types: [opened, synchronize, reopened]
|
||||
branches:
|
||||
- main
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
update_json:
|
||||
@ -13,29 +16,53 @@ jobs:
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
|
||||
- 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: Make script executable
|
||||
run: chmod +x .github/workflows/scripts/update_json_date.sh
|
||||
- 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,
|
||||
});
|
||||
|
||||
- name: Run the update script
|
||||
run: ./.github/workflows/scripts/update_json_date.sh
|
||||
// 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 with API keys
|
||||
- name: Push changes
|
||||
env:
|
||||
JSON_API_ID: ${{ secrets.JSON_API_ID }}
|
||||
JSON_API_KEY: ${{ secrets.JSON_API_KEY }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git remote set-url origin https://$JSON_API_ID:$JSON_API_KEY@github.com/${{ github.repository }}.git
|
||||
git push
|
||||
|
@ -24,6 +24,10 @@ 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))
|
||||
|
||||
### 🧰 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
|
||||
|
||||
### Changed
|
||||
|
@ -827,6 +827,7 @@ build_container() {
|
||||
export PASSWORD="$PW"
|
||||
export VERBOSE="$VERB"
|
||||
export SSH_ROOT="${SSH}"
|
||||
export SSH_AUTHORIZED_KEY
|
||||
export CTID="$CT_ID"
|
||||
export CTTYPE="$CT_TYPE"
|
||||
export PCT_OSTYPE="$var_os"
|
||||
|
@ -255,4 +255,11 @@ EOF
|
||||
fi
|
||||
echo "bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/${app}.sh)\"" >/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