Commit 6507289e authored by Grant's avatar Grant
Browse files

fetcher: use ci token

parent f004bf91
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@ lemmy fetcher:
  before_script:
    - apk add git
    - pip install requests
    - git config --global user.name "Cartographer [CI]"
    - git config --global user.email "canvas-atlas@sc07.com"
    - git remote set-url origin https://oauth2:${GITLAB_CI_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
  script:
    - python ./tools/lemmy_fetcher.py
  cache:
@@ -97,6 +100,6 @@ comment:
    - |
      # 📧 Post comment on MR
      curl --fail-with-body -X POST \
      --header "PRIVATE-TOKEN: ${GITLAB_CI_COMMENT_API_KEY}" \
      --header "PRIVATE-TOKEN: ${GITLAB_CI_TOKEN}" \
      --data-urlencode "body=$MR_BODY" \
      "$CI_API_V4_URL/projects/$CI_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID/notes"
+1 −6
Original line number Diff line number Diff line
@@ -17,11 +17,6 @@

LEMMY_HOST = "toast.ooo"

GIT_CONFIG = [
	"-c", "user.name=Atlas Bot [CI]",
	"-c", "user.email=canvas-atlas@sc07.com"
]

EDITIONS = {
	"2024": {
		"community": "2024lemmycanvasatlas",
@@ -178,7 +173,7 @@ def process_post(self, post_body, make_pr):
		if make_pr:
			if success:
				subprocess.check_call(["git", "add", EDITIONS[self.edition]["entry_folder"]])
				subprocess.check_call(["git", *GIT_CONFIG, "commit", "-m", "Add submission from Lemmy post " + str(post_id)])
				subprocess.check_call(["git" "commit", "-m", "Add submission from Lemmy post " + str(post_id)])
				subprocess.check_call(["git", "push", "--force", "origin", new_branch_name])
				pr_url = self.forge.does_pr_already_exist(new_branch_name)
				if pr_url == False: