mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-15 12:19:17 +00:00
Compare commits
1 Commits
42f1195ea9
...
234a1ba030
Author | SHA1 | Date | |
---|---|---|---|
|
234a1ba030 |
61
.github/workflows/auto-update-app-headers.yml
vendored
61
.github/workflows/auto-update-app-headers.yml
vendored
@ -6,7 +6,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'ct/**.sh'
|
- 'ct/**.sh'
|
||||||
workflow_dispatch:
|
workflow_dispatch: # Ermöglicht das manuelle Ausführen der Action
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-app-files:
|
update-app-files:
|
||||||
@ -21,21 +21,17 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
# Step 2: Disable file mode changes detection
|
# Step 2: Set up Git user for committing changes
|
||||||
- name: Disable file mode changes
|
|
||||||
run: git config core.fileMode false
|
|
||||||
|
|
||||||
# Step 3: Set up Git user for committing changes
|
|
||||||
- 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 "actions@github.com"
|
||||||
|
|
||||||
# Step 4: Install figlet
|
# Step 3: Install figlet
|
||||||
- name: Install figlet
|
- name: Install figlet
|
||||||
run: sudo apt-get install -y figlet
|
run: sudo apt-get install -y figlet
|
||||||
|
|
||||||
# Step 5: Run the updated generate-app-files.sh script
|
# Step 4: Run the updated generate-app-files.sh script
|
||||||
- name: Run generate-app-files.sh
|
- name: Run generate-app-files.sh
|
||||||
run: |
|
run: |
|
||||||
chmod +x .github/workflows/scripts/generate-app-headers.sh
|
chmod +x .github/workflows/scripts/generate-app-headers.sh
|
||||||
@ -43,40 +39,51 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# Step 6: Check if there are any changes
|
# Step 5: Check for changes
|
||||||
- name: Check if there are any changes
|
- name: Check if there are any changes
|
||||||
id: verify-diff
|
id: verify-diff
|
||||||
run: |
|
run: |
|
||||||
echo "Checking for changes..."
|
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
|
||||||
git status
|
|
||||||
if git diff --quiet; then
|
|
||||||
echo "No changes detected."
|
|
||||||
echo "changed=false" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "Changes detected:"
|
|
||||||
git diff --stat
|
|
||||||
echo "changed=true" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Step 7: Commit changes (if any) and create a PR
|
# Step 6: Commit changes (if any) and create a PR
|
||||||
- name: Commit and create PR if changes exist
|
- name: Commit and create PR if changes exist
|
||||||
if: steps.verify-diff.outputs.changed == 'true'
|
if: steps.verify-diff.outputs.changed == 'true'
|
||||||
run: |
|
run: |
|
||||||
git add -A
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add ct/*.app
|
||||||
git commit -m "Update .app files"
|
git commit -m "Update .app files"
|
||||||
git checkout -b pr-update-app-files
|
git checkout -b pr-update-app-files
|
||||||
git push origin pr-update-app-files --force
|
git push origin pr-update-app-files --force
|
||||||
|
|
||||||
|
# Create PR against main
|
||||||
gh pr create --title "[core] update .app files" \
|
gh pr create --title "[core] update .app files" \
|
||||||
--body "This PR is auto-generated by a GitHub Action to update the .app files." \
|
--body "This PR is auto-generated by a Github Action to update the .app files." \
|
||||||
--head pr-update-app-files \
|
--head pr-update-app-files \
|
||||||
--base main \
|
--base main \
|
||||||
--label "automated pr"
|
--label "automated pr"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# Step 8: Output success message when no changes
|
- name: Re-approve pull request after update
|
||||||
- name: No changes detected
|
if: steps.verify-diff.outputs.changed == 'true'
|
||||||
if: steps.verify-diff.outputs.changed == 'false'
|
env:
|
||||||
run: echo "No changes to commit. Workflow completed successfully."
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
# Get the PR number for the current branch
|
||||||
|
PR_NUMBER=$(gh pr list --head "pr-update-app-files" --json number --jq '.[].number')
|
||||||
|
|
||||||
|
# Check if a PR number was retrieved
|
||||||
|
if [ -n "$PR_NUMBER" ]; then
|
||||||
|
# Get the PR author
|
||||||
|
PR_AUTHOR=$(gh pr view "$PR_NUMBER" --json author --jq '.author.login')
|
||||||
|
|
||||||
|
# Approve the PR if it was not created by the bot
|
||||||
|
if [ "$PR_AUTHOR" != "github-actions[bot]" ]; then
|
||||||
|
gh pr review "$PR_NUMBER" --approve
|
||||||
|
else
|
||||||
|
echo "PR was created by the bot, skipping review."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No PR found for the current branch."
|
||||||
|
fi
|
||||||
|
22
.github/workflows/scripts/generate-app-headers.sh
vendored
Executable file → Normal file
22
.github/workflows/scripts/generate-app-headers.sh
vendored
Executable file → Normal file
@ -1,30 +1,24 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Base directory for headers
|
|
||||||
headers_dir="./ct/headers"
|
|
||||||
|
|
||||||
# Ensure the headers directory exists and clear it
|
|
||||||
mkdir -p "$headers_dir"
|
|
||||||
rm -f "$headers_dir"/*
|
|
||||||
|
|
||||||
# Find all .sh files in ./ct directory, sorted alphabetically
|
# Find all .sh files in ./ct directory, sorted alphabetically
|
||||||
find ./ct -type f -name "*.sh" | sort | while read -r script; do
|
find ./ct -type f -name "*.sh" | sort | while read -r script; do
|
||||||
# Extract the APP name from the APP line
|
# Extract the APP name from the APP line
|
||||||
app_name=$(grep -oP '^APP="\K[^"]+' "$script" 2>/dev/null)
|
app_name=$(grep -oP '^APP="\K[^"]+' "$script" 2>/dev/null)
|
||||||
|
|
||||||
if [[ -n "$app_name" ]]; then
|
if [[ -n "$app_name" ]]; then
|
||||||
# Define the output file name in the headers directory
|
# Define the output file name based on the .sh file
|
||||||
output_file="${headers_dir}/$(basename "${script%.*}")"
|
output_file="${script%.sh}.app"
|
||||||
|
|
||||||
# Generate figlet output
|
# Check if the output file already exists
|
||||||
figlet_output=$(figlet -f slant "$app_name")
|
if [[ ! -f "$output_file" ]]; then
|
||||||
|
# Generate figlet output
|
||||||
|
figlet_output=$(figlet -f slant "$app_name")
|
||||||
|
|
||||||
# Check if figlet output is not empty
|
# Write the figlet output to the file
|
||||||
if [[ -n "$figlet_output" ]]; then
|
|
||||||
echo "$figlet_output" > "$output_file"
|
echo "$figlet_output" > "$output_file"
|
||||||
echo "Generated: $output_file"
|
echo "Generated: $output_file"
|
||||||
else
|
else
|
||||||
echo "Figlet failed for $app_name in $script"
|
echo "Skipped: $output_file already exists"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "No APP name found in $script, skipping."
|
echo "No APP name found in $script, skipping."
|
||||||
|
@ -27,7 +27,6 @@ Do not break established syntax in this file, as it is automatically updated by
|
|||||||
|
|
||||||
### 🚀 Updated Scripts
|
### 🚀 Updated Scripts
|
||||||
|
|
||||||
- openHAB - Update to Zulu21 [@moodyblue](https://github.com/moodyblue) ([#1734](https://github.com/community-scripts/ProxmoxVE/pull/1734))
|
|
||||||
- Feature: Filebrowser Script > Redesign | Update Logic | Remove Logic [@MickLesk](https://github.com/MickLesk) ([#1716](https://github.com/community-scripts/ProxmoxVE/pull/1716))
|
- Feature: Filebrowser Script > Redesign | Update Logic | Remove Logic [@MickLesk](https://github.com/MickLesk) ([#1716](https://github.com/community-scripts/ProxmoxVE/pull/1716))
|
||||||
- Feature: Ubuntu 22.04 VM > Redesign | Optional HDD-Size Prompt [@MickLesk](https://github.com/MickLesk) ([#1712](https://github.com/community-scripts/ProxmoxVE/pull/1712))
|
- Feature: Ubuntu 22.04 VM > Redesign | Optional HDD-Size Prompt [@MickLesk](https://github.com/MickLesk) ([#1712](https://github.com/community-scripts/ProxmoxVE/pull/1712))
|
||||||
- Feature: Ubuntu 24.04 VM > Redesign | Optional HDD-Size Prompt | cifs support [@MickLesk](https://github.com/MickLesk) ([#1714](https://github.com/community-scripts/ProxmoxVE/pull/1714))
|
- Feature: Ubuntu 24.04 VM > Redesign | Optional HDD-Size Prompt | cifs support [@MickLesk](https://github.com/MickLesk) ([#1714](https://github.com/community-scripts/ProxmoxVE/pull/1714))
|
||||||
|
@ -43,10 +43,10 @@ function update_script() {
|
|||||||
msg_info "Updating ${APP} to ${RELEASE}"
|
msg_info "Updating ${APP} to ${RELEASE}"
|
||||||
cd /tmp
|
cd /tmp
|
||||||
wget -q https://github.com/actualbudget/actual-server/archive/refs/tags/v${RELEASE}.tar.gz
|
wget -q https://github.com/actualbudget/actual-server/archive/refs/tags/v${RELEASE}.tar.gz
|
||||||
|
tar -xzf v${RELEASE}.tar.gz >/dev/null 2>&1
|
||||||
mv /opt/actualbudget /opt/actualbudget_bak
|
mv /opt/actualbudget /opt/actualbudget_bak
|
||||||
mkdir -p /opt/actualbudget/
|
mkdir -p /opt/actualbudget/
|
||||||
tar -xzf v${RELEASE}.tar.gz >/dev/null 2>&1
|
mv *ctual-server-* /opt/actualbudget
|
||||||
mv *ctual-server-*/* /opt/actualbudget
|
|
||||||
mv /opt/actualbudget_bak/.env /opt/actualbudget
|
mv /opt/actualbudget_bak/.env /opt/actualbudget
|
||||||
mv /opt/actualbudget_bak/server-files /opt/actualbudget/server-files
|
mv /opt/actualbudget_bak/server-files /opt/actualbudget/server-files
|
||||||
cd /opt/actualbudget
|
cd /opt/actualbudget
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user