fix repo name
This commit is contained in:
@@ -17,8 +17,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||||
INSTANCE_URL: ${{ vars.INSTANCE_URL }}
|
INSTANCE_URL: ${{ vars.INSTANCE_URL }}
|
||||||
REPO_OWNER: ${{ gitea.repository_owner }}
|
REPOSITORY: ${{ gitea.repository }}
|
||||||
REPO_NAME: ${{ gitea.repository }}
|
|
||||||
TAG_NAME: 'stale'
|
TAG_NAME: 'stale'
|
||||||
DAYS_OLD: 3
|
DAYS_OLD: 3
|
||||||
EXCLUDE_TAG_NAME: ''
|
EXCLUDE_TAG_NAME: ''
|
||||||
@@ -29,7 +28,7 @@ jobs:
|
|||||||
sudo apt-get -qq update && sudo apt-get -qq install -y jq curl
|
sudo apt-get -qq update && sudo apt-get -qq install -y jq curl
|
||||||
|
|
||||||
# --- Conditionally build the API URL ---
|
# --- Conditionally build the API URL ---
|
||||||
API_URL="${INSTANCE_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues?state=open"
|
API_URL="${INSTANCE_URL}/api/v1/repos/${REPOSITORY}/issues?state=open"
|
||||||
if [[ -n "${REQUIRED_TAG}" ]]; then
|
if [[ -n "${REQUIRED_TAG}" ]]; then
|
||||||
echo ">> Filtering for issues with the required tag: ${REQUIRED_TAG}"
|
echo ">> Filtering for issues with the required tag: ${REQUIRED_TAG}"
|
||||||
# URL-encode the tag to handle special characters
|
# URL-encode the tag to handle special characters
|
||||||
@@ -65,7 +64,7 @@ jobs:
|
|||||||
EXISTING_LABELS=$(curl -s -X GET \
|
EXISTING_LABELS=$(curl -s -X GET \
|
||||||
-H "Authorization: token ${BOT_TOKEN}" \
|
-H "Authorization: token ${BOT_TOKEN}" \
|
||||||
-H "Accept: application/json" \
|
-H "Accept: application/json" \
|
||||||
"${INSTANCE_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues/${ISSUE_NUMBER}/labels" | jq -r '.[].name')
|
"${INSTANCE_URL}/api/v1/repos/${REPOSITORY}/issues/${ISSUE_NUMBER}/labels" | jq -r '.[].name')
|
||||||
|
|
||||||
# Add the new tag to the list of existing labels
|
# 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))')
|
NEW_LABELS=$(echo -e "${EXISTING_LABELS}\n${TAG_NAME}" | sort -u | jq -R -s -c 'split("\n") | map(select(length > 0))')
|
||||||
@@ -76,7 +75,7 @@ jobs:
|
|||||||
-H "Authorization: token ${BOT_TOKEN}" \
|
-H "Authorization: token ${BOT_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"labels\": $(echo "$NEW_LABELS" | jq -r 'map(select(. != ""))')}" \
|
-d "{\"labels\": $(echo "$NEW_LABELS" | jq -r 'map(select(. != ""))')}" \
|
||||||
"${INSTANCE_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues/${ISSUE_NUMBER}/labels"
|
"${INSTANCE_URL}/api/v1/repos/${REPOSITORY}/issues/${ISSUE_NUMBER}/labels"
|
||||||
else
|
else
|
||||||
echo ">> Skipping issue #${ISSUE_NUMBER} because it has the '${EXCLUDE_TAG_NAME}' tag."
|
echo ">> Skipping issue #${ISSUE_NUMBER} because it has the '${EXCLUDE_TAG_NAME}' tag."
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user