Compare commits
16 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9933c4bed | |||
|
|
f733b705a2 | ||
| d1a799d1c6 | |||
|
|
aac88fc4db | ||
| 3198d19f8b | |||
| 622baf5089 | |||
|
|
2f1a1d4777 | ||
| d9004715ca | |||
| 085dd46afc | |||
| 2128742b51 | |||
| 2aa3fdc84d | |||
| 96a1977368 | |||
| 76ca009d05 | |||
| e6bb11d2ea | |||
| f75472ecd0 | |||
| 0dce7aa37f |
6 changed files with 38 additions and 21 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
FROM python:3.11-slim
|
FROM python:3.14-slim@sha256:2751cbe93751f0147bc1584be957c6dd4c5f977c3d4e0396b56456a9fd4ed137
|
||||||
|
|
||||||
# Install deps
|
# Install deps
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
name: "Forgejo Release Drafter"
|
name: "Forgejo Release Drafter"
|
||||||
description: "Custom action that drafts releases in Forgejo using a Python script"
|
description: "Custom action that drafts releases in Forgejo using a Python script"
|
||||||
inputs:
|
inputs:
|
||||||
forgejo-token:
|
token:
|
||||||
description: "API token for Forgejo"
|
description: "Forgejo API token"
|
||||||
required: true
|
required: true
|
||||||
repo:
|
repo:
|
||||||
description: "Forgejo repo (e.g. org/project)"
|
description: "Forgejo repo (e.g. org/project)"
|
||||||
required: true
|
required: true
|
||||||
api-endpoint:
|
endpoint:
|
||||||
description: "Forgejo api endpoint (e.g. https://<your-domain>/api/v1)"
|
description: "Forgejo api endpoint (e.g. https://<your-domain>/api/v1)"
|
||||||
required: true
|
required: true
|
||||||
outputs:
|
outputs:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
python /release_drafter.py \
|
python /release_drafter.py
|
||||||
--token "${INPUT_FORGEJO_TOKEN}" \
|
|
||||||
--repo "${INPUT_REPO}" \
|
|
||||||
--endpoint "${INPUT_API_ENDPOINT}"
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import argparse
|
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from datetime import timezone
|
from datetime import timezone
|
||||||
|
|
@ -11,6 +10,10 @@ import semver
|
||||||
from requests.adapters import HTTPAdapter
|
from requests.adapters import HTTPAdapter
|
||||||
from urllib3 import Retry
|
from urllib3 import Retry
|
||||||
|
|
||||||
|
print("DEBUG: env vars seen by Python")
|
||||||
|
for k, v in os.environ.items():
|
||||||
|
if k.startswith("INPUT_"):
|
||||||
|
print(f"{k}={v}")
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
@ -46,16 +49,10 @@ class ReleaseManager:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def validate_environment() -> Dict[str, str]:
|
def validate_environment() -> Dict[str, str]:
|
||||||
"""Validate all required environment variables are present."""
|
"""Validate all required environment variables are present."""
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument("--token", required=True)
|
|
||||||
parser.add_argument("--repo", required=True)
|
|
||||||
parser.add_argument("--endpoint", required=True)
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
required_vars = {
|
required_vars = {
|
||||||
"FORGEJO_API_URL": args.endpoint,
|
"FORGEJO_API_URL": os.getenv("INPUT_ENDPOINT"),
|
||||||
"REPO": args.repo,
|
"REPO": os.getenv("INPUT_REPO"),
|
||||||
"FORGEJO_TOKEN": args.token,
|
"FORGEJO_TOKEN": os.getenv("INPUT_TOKEN"),
|
||||||
}
|
}
|
||||||
|
|
||||||
missing_vars = [var for var, value in required_vars.items() if not value]
|
missing_vars = [var for var, value in required_vars.items() if not value]
|
||||||
|
|
@ -469,7 +466,9 @@ Compare with previous version: [{previous_tag}...{new_tag}]({url_base}/{self.rep
|
||||||
release_notes, latest_tag, comparison_tag
|
release_notes, latest_tag, comparison_tag
|
||||||
)
|
)
|
||||||
url = self.create_or_update_release(comparison_tag, release_notes, existing_draft)
|
url = self.create_or_update_release(comparison_tag, release_notes, existing_draft)
|
||||||
print(f"::set-output name=release-url::{url}")
|
|
||||||
|
with open(os.environ["GITHUB_OUTPUT"], "a") as gh_out:
|
||||||
|
gh_out.write(f"release-url={url}\n")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"An error occurred: {str(e)}")
|
print(f"An error occurred: {str(e)}")
|
||||||
|
|
|
||||||
20
renovate.json
Normal file
20
renovate.json
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"local>entwirr.me/renovate-config"
|
||||||
|
],
|
||||||
|
"commitMessagePrefix": "chore(deps):",
|
||||||
|
"enabledManagers": ["dockerfile", "github-actions", "pip_requirements"],
|
||||||
|
"rangeStrategy": "update-lockfile",
|
||||||
|
"updatePinnedDependencies": true,
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"matchPackageNames": ["*"],
|
||||||
|
"matchUpdateTypes": ["major", "minor", "patch", "pin", "digest"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matchManagers": ["composer", "github-actions", "pip_requirements"],
|
||||||
|
"addLabels": ["chore"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
requests
|
requests~=2.32.5
|
||||||
semver
|
semver~=3.0.4
|
||||||
|
urllib3~=2.6.0
|
||||||
Loading…
Add table
Add a link
Reference in a new issue