From 1d8f8c63df75cbca69d39eba2b385c992d84eec8 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sun, 18 Feb 2024 13:13:51 +0100 Subject: [PATCH] Enhanced workflow with environment variables Introduced a set of environment variables in the CI workflow configuration to align with the chores script's requirements. The workflow now passes explicit values for necessary variables, matching the environment variable name changes in the chores script for consistency and clarity. Ensured correct token usage by updating TO token reference. This change facilitates better configuration management and error handling in automated tasks. --- .forgejo/workflows/chores.yml | 8 ++++++++ scripts/chores.py | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/chores.yml b/.forgejo/workflows/chores.yml index b157dff..2dfe29d 100644 --- a/.forgejo/workflows/chores.yml +++ b/.forgejo/workflows/chores.yml @@ -4,6 +4,14 @@ on: [push] jobs: chores: + env: + FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} + FORGEJO_URL: ${{ FORGEJO_URL }} + CHORES_ASSIGNEES: ${{ CHORES_ASSIGNEES }} + CHORES_REPO_OWNER: ${{ CHORES_REPO_OWNER }} + CHORES_REPO_NAME: ${{ CHORES_REPO_NAME }} + CHORES_EXPIRY_DAYS: ${{ CHORES_EXPIRY_DAYS }} + CHORES_TEXT: ${{ CHORES_TEXT }} steps: - name: Check out repository uses: actions/checkout@v4 diff --git a/scripts/chores.py b/scripts/chores.py index 91d91c2..865d476 100644 --- a/scripts/chores.py +++ b/scripts/chores.py @@ -10,9 +10,9 @@ from datetime import datetime, timedelta FORGEJO_URL = os.environ.get("FORGEJO_URL", "https://git.private.coffee") try: - TOKEN = os.environ["PIPELINES_TOKEN"] + TOKEN = os.environ["FORGEJO_TOKEN"] except KeyError: - logging.error("PIPELINES_TOKEN environment variable is required") + logging.error("FORGEJO_TOKEN environment variable is required") exit(1) ASSIGNEES = os.environ.get("CHORES_ASSIGNEES", "").split()