forgejo: rename FORGEJO_TOKEN to ISSUE_TOKEN

This commit is contained in:
Antoine Martin 2025-02-18 11:41:08 -05:00
parent 3e68c6c54e
commit 8963a82eaa
Signed by: ayakael
GPG key ID: D62A472A4AA7D541
2 changed files with 9 additions and 9 deletions

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# expects: # expects:
# env variable FORGEJO_TOKEN # env variable ISSUE_TOKEN
# file out_of_date # file out_of_date
IFS=' IFS='
@ -20,7 +20,7 @@ does_it_exist() {
result="$(curl --silent -X 'GET' \ result="$(curl --silent -X 'GET' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \
-H 'accept: application/json' \ -H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" -H "authorization: Basic $ISSUE_TOKEN"
)" )"
if [ "$result" == "[]" ]; then if [ "$result" == "[]" ]; then
@ -40,7 +40,7 @@ is_it_old() {
result="$(curl --silent -X 'GET' \ result="$(curl --silent -X 'GET' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \
-H 'accept: application/json' \ -H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" -H "authorization: Basic $ISSUE_TOKEN"
)" )"
result_title="$(echo $result | jq -r '.[].title' )" result_title="$(echo $result | jq -r '.[].title' )"
@ -64,7 +64,7 @@ update_title() {
result=$(curl --silent -X 'PATCH' \ result=$(curl --silent -X 'PATCH' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$id" \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$id" \
-H 'accept: application/json' \ -H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \ -H "authorization: Basic $ISSUE_TOKEN" \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d "{ -d "{
\"title\": \"$repo/$name: upgrade to $upstream_version\" \"title\": \"$repo/$name: upgrade to $upstream_version\"
@ -83,7 +83,7 @@ create_issue() {
result=$(curl --silent -X 'POST' \ result=$(curl --silent -X 'POST' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \
-H 'accept: application/json' \ -H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \ -H "authorization: Basic $ISSUE_TOKEN" \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d "{ -d "{
\"title\": \"$repo/$name: upgrade to $upstream_version\", \"title\": \"$repo/$name: upgrade to $upstream_version\",
@ -131,7 +131,7 @@ if [ -f not_in_anitya ]; then
result="$(curl --silent -X 'GET' \ result="$(curl --silent -X 'GET' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \
-H 'accept: application/json' \ -H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" -H "authorization: Basic $ISSUE_TOKEN"
)" )"
if [ "$result" == "[]" ]; then if [ "$result" == "[]" ]; then
@ -139,7 +139,7 @@ if [ -f not_in_anitya ]; then
result=$(curl --silent -X 'POST' \ result=$(curl --silent -X 'POST' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \
-H 'accept: application/json' \ -H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \ -H "authorization: Basic $ISSUE_TOKEN" \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d "{ -d "{
\"title\": \"Add missing $repo packages to anitya\", \"title\": \"Add missing $repo packages to anitya\",
@ -155,7 +155,7 @@ if [ -f not_in_anitya ]; then
result=$(curl --silent -X 'PATCH' \ result=$(curl --silent -X 'PATCH' \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$result_id" \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$result_id" \
-H 'accept: application/json' \ -H 'accept: application/json' \
-H "authorization: Basic $FORGEJO_TOKEN" \ -H "authorization: Basic $ISSUE_TOKEN" \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d "{ -d "{
\"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\" \"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\"

View file

@ -12,7 +12,7 @@ jobs:
image: alpine:latest image: alpine:latest
env: env:
downstream: https://forge.ilot.io/api/packages/ilot/alpine/v3.21/ilot downstream: https://forge.ilot.io/api/packages/ilot/alpine/v3.21/ilot
FORGEJO_TOKEN: ${{ secrets.forgejo_token }} ISSUE_TOKEN: ${{ secrets.issue_token }}
LABEL_NUMBER: 8 LABEL_NUMBER: 8
steps: steps:
- name: Environment setup - name: Environment setup