Compare commits
2 Commits
19e5da5280
...
7739533658
Author | SHA1 | Date | |
---|---|---|---|
7739533658
|
|||
91c728d5aa |
35
.gitea/workflows/process-issues.yaml
Normal file
35
.gitea/workflows/process-issues.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
name: process-issues
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '@daily'
|
||||
|
||||
jobs:
|
||||
process-issues:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Python Script
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: alexlebens/workflow-scripts
|
||||
ref: main
|
||||
token: ${{ secrets.BOT_TOKEN }}
|
||||
path: scripts
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.13'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install requests
|
||||
|
||||
- name: Run Script
|
||||
env:
|
||||
INSTANCE_URL: ${{ vars.INSTANCE_URL }}
|
||||
REPOSITORY: ${{ gitea.repository }}
|
||||
TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
STALE_DAYS: 3
|
||||
STALE_TAG: 'stale'
|
||||
EXCLUDE_TAG: 'renovate'
|
||||
run: python ./scripts/scripts/process-issues.py
|
35
.gitea/workflows/process-pull-requests.yaml
Normal file
35
.gitea/workflows/process-pull-requests.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
name: process-pull-requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '@daily'
|
||||
|
||||
jobs:
|
||||
process-pull-requests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Python Script
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: alexlebens/workflow-scripts
|
||||
ref: main
|
||||
token: ${{ secrets.BOT_TOKEN }}
|
||||
path: scripts
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.13'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install requests
|
||||
|
||||
- name: Run Script
|
||||
env:
|
||||
INSTANCE_URL: ${{ vars.INSTANCE_URL }}
|
||||
REPOSITORY: ${{ gitea.repository }}
|
||||
TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
STALE_DAYS: 3
|
||||
STALE_TAG: 'stale'
|
||||
REQUIRED_TAG: 'automerge'
|
||||
run: python ./scripts/scripts/process-pull-requests.py
|
@@ -1,75 +0,0 @@
|
||||
name: tag-old-issues
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "@daily"
|
||||
|
||||
jobs:
|
||||
tag-old-issues:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Tag Old Issues
|
||||
env:
|
||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||
INSTANCE_URL: ${{ vars.INSTANCE_URL }}
|
||||
REPO_OWNER: ${{ github.repository_owner }}
|
||||
REPO_NAME: ${{ github.repository_name }}
|
||||
TAG_NAME: 'stale'
|
||||
DAYS_OLD: 3
|
||||
EXCLUDE_TAG_NAME: ''
|
||||
REQUIRED_TAG: 'automerge'
|
||||
run: |
|
||||
# Install necessary tools
|
||||
apt-get update && apt-get install -y jq curl
|
||||
|
||||
# --- Conditionally build the API URL ---
|
||||
API_URL="${GITEA_INSTANCE_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues?state=open"
|
||||
if [[ -n "${REQUIRED_TAG}" ]]; then
|
||||
echo "Filtering for issues with the required tag: ${REQUIRED_TAG}"
|
||||
# URL-encode the tag to handle special characters
|
||||
ENCODED_TAG=$(jq -s -R -r @uri <<< "${REQUIRED_TAG}")
|
||||
API_URL="${API_URL}&labels=${ENCODED_TAG}"
|
||||
else
|
||||
echo "No required tag specified. Checking all open issues."
|
||||
fi
|
||||
|
||||
# Fetch issues using the constructed URL
|
||||
ISSUES=$(curl -s -X GET \
|
||||
-H "Authorization: token ${BOT_TOKEN}" \
|
||||
-H "Accept: application/json" \
|
||||
"${API_URL}")
|
||||
|
||||
# Calculate the date ${DAYS_OLD} days ago in ISO 8601 format
|
||||
OLDER_THAN_DATE=$(date -d "-${DAYS_OLD} days" -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||
|
||||
# Filter issues older than the specified date and without the exclusion tag
|
||||
echo "$ISSUES" | jq -c '.[] | select(.created_at < "'"$OLDER_THAN_DATE"'")' | while read -r issue; do
|
||||
ISSUE_NUMBER=$(echo "$issue" | jq -r '.number')
|
||||
LABELS=$(echo "$issue" | jq -r '.labels[].name')
|
||||
|
||||
# Check if the issue has the exclusion tag
|
||||
if ! echo "$LABELS" | grep -q -w "${EXCLUDE_TAG_NAME}"; then
|
||||
echo "Tagging issue #${ISSUE_NUMBER} as ${TAG_NAME}"
|
||||
|
||||
# Get existing labels for the issue
|
||||
EXISTING_LABELS=$(curl -s -X GET \
|
||||
-H "Authorization: token ${BOT_TOKEN}" \
|
||||
-H "Accept: application/json" \
|
||||
"${INSTANCE_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues/${ISSUE_NUMBER}/labels" | jq -r '.[].name')
|
||||
|
||||
# Add the new tag to the list of existing labels
|
||||
NEW_LABELS=$(echo -e "${EXISTING_LABELS}\n${TAG_NAME}" | sort -u | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
||||
|
||||
# Update the issue with the new set of labels
|
||||
curl -s -X PUT \
|
||||
-H "Authorization: token ${BOT_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"labels\": $(echo "$NEW_LABELS" | jq -r 'map(select(. != ""))')}" \
|
||||
"${INSTANCE_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues/${ISSUE_NUMBER}/labels"
|
||||
else
|
||||
echo "Skipping issue #${ISSUE_NUMBER} because it has the '${EXCLUDE_TAG_NAME}' tag."
|
||||
fi
|
||||
done
|
@@ -32,7 +32,7 @@ dependencies:
|
||||
version: 1.15.0
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/directus.png
|
||||
appVersion: 11.7.2
|
||||
|
@@ -27,7 +27,7 @@ dependencies:
|
||||
version: 1.15.0
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/freshrss.png
|
||||
appVersion: 1.26.2
|
||||
|
@@ -25,7 +25,7 @@ dependencies:
|
||||
repository: oci://harbor.alexlebens.net/proxy-registry-1.docker.io/bitnamicharts
|
||||
- name: postgres-cluster
|
||||
alias: postgres-16-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/immich.png
|
||||
appVersion: v1.132.3
|
||||
|
@@ -21,7 +21,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/jellystat.png
|
||||
appVersion: 1.1.6
|
||||
|
@@ -24,7 +24,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/lidarr.png
|
||||
appVersion: 2.11.2
|
||||
|
@@ -33,7 +33,7 @@ dependencies:
|
||||
version: 1.15.0
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/outline.png
|
||||
appVersion: 0.84.0
|
||||
|
@@ -20,7 +20,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/photoview.png
|
||||
appVersion: 2.4.0
|
||||
|
@@ -31,7 +31,7 @@ dependencies:
|
||||
version: 1.15.0
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/postiz.png
|
||||
appVersion: v1.43.3
|
||||
|
@@ -27,7 +27,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/radarr-4k.png
|
||||
appVersion: 5.22.4
|
||||
|
@@ -27,7 +27,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/radarr-anime.png
|
||||
appVersion: 5.22.4
|
||||
|
@@ -26,7 +26,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/radarr.png
|
||||
appVersion: 5.22.4
|
||||
|
@@ -26,7 +26,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/radarr.png
|
||||
appVersion: 5.22.4
|
||||
|
@@ -21,7 +21,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/roundcube.png
|
||||
appVersion: 1.6.10
|
||||
|
@@ -27,7 +27,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/sonarr.png
|
||||
appVersion: 4.0.14
|
||||
|
@@ -26,7 +26,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/sonarr.png
|
||||
appVersion: 4.0.14
|
||||
|
@@ -26,7 +26,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/sonarr.png
|
||||
appVersion: 4.0.14
|
||||
|
@@ -28,7 +28,7 @@ dependencies:
|
||||
version: 1.15.0
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/vaultwarden.png
|
||||
appVersion: 1.33.2
|
||||
|
@@ -27,7 +27,7 @@ dependencies:
|
||||
repository: oci://harbor.alexlebens.net/proxy-registry-1.docker.io/bitnamicharts
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/yamtrack.png
|
||||
appVersion: 0.22.7
|
||||
|
@@ -25,7 +25,7 @@ dependencies:
|
||||
repository: https://argoproj.github.io/argo-helm
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/argo-cd.png
|
||||
appVersion: v3.6.7
|
||||
|
@@ -23,7 +23,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/komodo.png
|
||||
appVersion: v1.17.5
|
||||
|
@@ -22,7 +22,7 @@ dependencies:
|
||||
version: 1.3.0
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/gatus.png
|
||||
appVersion: v5.12.0
|
||||
|
@@ -29,7 +29,7 @@ dependencies:
|
||||
repository: oci://harbor.alexlebens.net/proxy-registry-1.docker.io/bitnamicharts
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/grafana.png
|
||||
appVersion: v5.18.0
|
||||
|
@@ -29,7 +29,7 @@ dependencies:
|
||||
version: 1.15.0
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/authentik.png
|
||||
appVersion: 2025.4.1
|
||||
|
@@ -53,7 +53,7 @@ dependencies:
|
||||
version: 1.15.0
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/png/gitea.png
|
||||
appVersion: 1.23.7
|
||||
|
@@ -63,7 +63,7 @@ dependencies:
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/matrix.png
|
||||
appVersion: 1.129.0
|
||||
|
@@ -26,7 +26,7 @@ dependencies:
|
||||
repository: oci://harbor.alexlebens.net/proxy-registry-1.docker.io/bitnamicharts
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/n8n.png
|
||||
appVersion: 1.93.0
|
||||
|
@@ -23,7 +23,7 @@ dependencies:
|
||||
version: 4.0.1
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/ollama.png
|
||||
appVersion: 0.7.0
|
||||
|
@@ -32,7 +32,7 @@ dependencies:
|
||||
repository: oci://harbor.alexlebens.net/proxy-registry-1.docker.io/bitnamicharts
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: oci://harbor.alexlebens.net/helm-charts
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/stalwart-mail-server.png
|
||||
appVersion: v0.11.8
|
||||
|
@@ -26,7 +26,7 @@ dependencies:
|
||||
repository: oci://harbor.alexlebens.net/proxy-registry-1.docker.io/bitnamicharts
|
||||
- name: postgres-cluster
|
||||
alias: postgres-17-cluster
|
||||
version: 5.1.0
|
||||
version: 6.4.4
|
||||
repository: http://gitea-http.gitea:3000/api/packages/alexlebens/helm
|
||||
icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/harbor.png
|
||||
appVersion: v2.13.0
|
||||
|
Reference in New Issue
Block a user