Compare commits

...

9 Commits

Author SHA1 Message Date
Paul
ffb3abc51f
Merge 84e5fafd0d into 4da57bd76c 2025-01-07 18:03:27 -05:00
Sébastiaan
4da57bd76c
fix: permissions of validate pipelines (#1316)
Some checks are pending
Create Changelog Pull Request / update-changelog-pull-request (push) Waiting to run
Shellcheck / Shellcheck (push) Waiting to run
Validate script formatting / Check changed files (push) Waiting to run
Validate scripts / Check changed files (push) Waiting to run
* Fix permission in validate-filenames pipeline

* Run Github Actions for script validation on pull_request_target with right permissions
2025-01-07 20:34:37 +01:00
CanbiZ
29b98b450b
Rename validate-formatting.yaml.bak to validate-formatting.yaml
Some checks are pending
Create Changelog Pull Request / update-changelog-pull-request (push) Waiting to run
Shellcheck / Shellcheck (push) Waiting to run
Validate script formatting / Check changed files (push) Waiting to run
Validate scripts / Check changed files (push) Waiting to run
2025-01-07 08:58:43 +01:00
CanbiZ
c88d3a3883
Rename validate-filenames.yml.bak to validate-filenames.yml 2025-01-07 08:58:27 +01:00
community-scripts-pr-app[bot]
f5a54bc3ad
Update CHANGELOG.md (#1310)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-01-07 08:57:50 +01:00
CanbiZ
2078deca57
Set Execution Rights for GH-Action: Validate Scripts (#1312) 2025-01-07 08:53:52 +01:00
Michel Roegl-Brunner
bc702e2a6d
Fix Script: Zammad (#1309) 2025-01-07 08:49:44 +01:00
Paul William
84e5fafd0d Simplified functions, as per the feedback, also use only wget 2024-11-19 21:28:44 +13:00
Paul William
24a7149794 Adds utility functions to download the latest release of a project from github and untars it. Uses curls and standard gnu tools. 2024-11-18 21:55:50 +13:00
6 changed files with 80 additions and 9 deletions

View File

@ -1,23 +1,36 @@
name: Validate filenames
on:
pull_request:
pull_request_target:
paths:
- "ct/*.sh"
- "install/*.sh"
- "json/*.json"
- ".github/workflows/validate-filenames.yml"
jobs:
check-files:
name: Check changed files
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Get pull request information
uses: actions/github-script@v7
id: pr
with:
script: |
const { data: pullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.payload.pull_request.number,
});
return pullRequest;
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure the full history is fetched for accurate diffing
ref: ${{ fromJSON(steps.pr.outputs.result).merge_commit_sha }}
- name: Get changed files
id: changed-files

View File

@ -4,11 +4,10 @@ on:
push:
branches:
- main
pull_request:
pull_request_target:
paths:
- "**/*.sh"
- "**/*.func"
- ".github/workflows/validate-formatting.yaml"
jobs:
shfmt:
@ -18,10 +17,22 @@ jobs:
pull-requests: write
steps:
- name: Get pull request information
uses: actions/github-script@v7
id: pr
with:
script: |
const { data: pullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.payload.pull_request.number,
});
return pullRequest;
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 0 # Ensure the full history is fetched for accurate diffing
ref: ${{ fromJSON(steps.pr.outputs.result).merge_commit_sha }}
- name: Get changed files
id: changed-files

View File

@ -3,11 +3,10 @@ on:
push:
branches:
- main
pull_request:
pull_request_target:
paths:
- "ct/*.sh"
- "install/*.sh"
- ".github/workflows/validate-scripts.yml"
jobs:
check-scripts:
@ -17,10 +16,26 @@ jobs:
pull-requests: write
steps:
- name: Get pull request information
uses: actions/github-script@v7
id: pr
with:
script: |
const { data: pullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.payload.pull_request.number,
});
return pullRequest;
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
fetch-depth: 0 # Ensure the full history is fetched for accurate diffing
ref: ${{fromJSON(steps.pr.outputs.result).merge_commit_sha}}
- name: Set execute permission for .sh files
run: |
chmod +x ct/*.sh
- name: Get changed files
id: changed-files

View File

@ -16,6 +16,18 @@ All LXC instances created using this repository come pre-installed with Midnight
> [!IMPORTANT]
Do not break established syntax in this file, as it is automatically updated by a Github Workflow
## 2025-01-07
### Changed
### 🚀 Updated Scripts
- Fix: Folder-Check for Updatescript Zammad [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#1309](https://github.com/community-scripts/ProxmoxVE/pull/1309))
### 🧰 Maintenance
- Set Execution Rights for GH-Action: Validate Scripts [@MickLesk](https://github.com/MickLesk) ([#1312](https://github.com/community-scripts/ProxmoxVE/pull/1312))
## 2025-01-06
### Changed

View File

@ -28,7 +28,7 @@ function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/zamad ]]; then
if [[ ! -d /opt/zammad ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi

View File

@ -256,3 +256,23 @@ EOF
echo "bash -c \"\$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/${app}.sh)\"" >/usr/bin/update
chmod +x /usr/bin/update
}
# This function downloads the latest release of a GitHub repository
github_download_latest_release() {
local user="$1"
local repo="$2"
local output_file="$3"
local tarball_url=$($STD wget -qLO - "https://api.github.com/repos/$user/$repo/releases/latest" | grep '"tarball_url":' | cut -d '"' -f 4)
$STD wget -qLO "$output_file" "$tarball_url"
}
# This function extracts a GitHub release tarball into a target directory
github_extract_latest_release() {
local user="$1"
local repo="$2"
local output_directory="$3"
mkdir -p "$output_directory"
github_download_latest_release "$user" "$repo" "/tmp/$repo.tar.gz"
tar -xzf "/tmp/$repo.tar.gz" -C "$output_directory" --strip-components 1
rm "/tmp/$repo.tar.gz"
}