{"id":31164249,"url":"https://github.com/scanf-s/github-autofollow","last_synced_at":"2025-09-19T07:55:59.440Z","repository":{"id":255784522,"uuid":"853605721","full_name":"Scanf-s/github-autofollow","owner":"Scanf-s","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-16T06:47:40.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-16T08:37:39.921Z","etag":null,"topics":["aws-eventbridge","aws-lambda","github-api","python","uv"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Scanf-s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-07T02:51:37.000Z","updated_at":"2025-09-16T06:47:43.000Z","dependencies_parsed_at":"2025-05-31T22:00:07.872Z","dependency_job_id":"e334bd02-17bb-4673-b92b-5042f0071893","html_url":"https://github.com/Scanf-s/github-autofollow","commit_stats":null,"previous_names":["scanf-s/autofollownunfollow","scanf-s/github-autofollow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Scanf-s/github-autofollow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scanf-s%2Fgithub-autofollow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scanf-s%2Fgithub-autofollow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scanf-s%2Fgithub-autofollow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scanf-s%2Fgithub-autofollow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Scanf-s","download_url":"https://codeload.github.com/Scanf-s/github-autofollow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scanf-s%2Fgithub-autofollow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275901964,"owners_count":25549241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-eventbridge","aws-lambda","github-api","python","uv"],"created_at":"2025-09-19T07:55:58.282Z","updated_at":"2025-09-19T07:55:59.426Z","avatar_url":"https://github.com/Scanf-s.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless 아키텍쳐 기반 깃허브 자동 팔로우/언팔로우 스크립트\n\n깃허브 팔로우/언팔로우 수동으로 하기 귀찮아서 자동화 스크립트 만들었고,  \nAWS Serverless 기능들 사용해서 하루에 한번씩 실행되도록 구성했습니다.  \nFree tier 기준 비용 안나오니 안심해주세요.\n\n팔로워 여러명있을 때 동기식으로 처리하면 오래걸리니까, aiohttp 사용해서 비동기로 처리하도록, 코루틴 함수 기반으로 작성되어 있습니다.\n\n\u003cimg width=\"1108\" height=\"223\" alt=\"스크린샷 2025-09-16 오후 3 45 36\" src=\"https://github.com/user-attachments/assets/3b573ad4-91bc-480e-9f80-5c6671eb2b3e\" /\u003e\n\n# AWS Lambda + EventBridge 배포 가이드\n\n## 1. Docker 이미지 빌드 및 ECR 푸시\n\n```bash\n# ECR 리포지토리 생성\naws ecr create-repository --repository-name ECR레포지토리이름\n\n# Docker 이미지 빌드 (Ubuntu/Linux)\ndocker build -t ECRIMAGE경로 .\n# (MAC)\ndocker buildx build --platform linux/amd64 -t ECRIMAGE경로 .\n\n# ECR 로그인\naws ecr get-login-password --region \u003caws-region\u003e | docker login --username AWS --password-stdin \u003cpassword\u003e\n\n# 이미지 푸시\ndocker push ECRIMAGE경로\n```\n\n## 2. IAM 역할 생성\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n          \"Effect\": \"Allow\",\n          \"Principal\": {\n            \"Service\": \"lambda.amazonaws.com\"\n          },\n          \"Action\": \"sts:AssumeRole\"\n        }\n    ]\n}\n```\n이렇게 Assume Role을 지정해주고, 연결되는 정책에 AWSLambdaBasicExecutionRole 또는 귀찮으면 FullAcces 추가 `!해당 정책 ARN 기억해두기!`\n\n## 3. Lambda 함수 생성\n\n```bash\n# Lambda 함수 생성 (Container Image)\naws lambda create-function \\\n    --function-name LAMBDA_NAME \\\n    --package-type Image \\\n    --code ImageUri=이미지경로 \\\n    --role 2번에서지정한RoleARN \\\n    --timeout 300 \\\n    --memory-size 512 \\\n    --environment \"Variables={GITHUB_USERNAME=깃허브사용자이름,GITHUB_TOKEN=토큰이름,GITHUB_API_URL=https://api.github.com}\"\n  \n# 확인 방법\naws lambda get-function --function-name LAMBDA_NAME\n```\n\n## 4. EventBridge 스케줄 생성\n\n```bash\n# EventBridge 규칙 생성 (한국시간 기준 매일 오전 9시 실행)\naws events put-rule \\\n    --name EVENTBRIDGE_NAME \\\n    --schedule-expression \"cron(0 9 * * ? *)\" \\\n    --description \"Daily GitHub auto follow/unfollow\"\n\n# 이거 생성하고 ARN확인하는 방법\naws events list-rules --name-prefix EVENTBRIDGE_NAME\n\n# Lambda에 Eventbridge 권한 부여\naws lambda add-permission \\\n    --function-name LAMBDA_NAME \\\n    --statement-id allow-eventbridge \\\n    --action lambda:InvokeFunction \\\n    --principal events.amazonaws.com \\\n    --source-arn EVENTBRIDGE_ARN\n    \n# Lambda 함수를 타겟으로 추가\naws events put-targets \\\n  --rule EVENTBRIDGE_NAME \\\n  --targets \"Id\"=\"1\",\"Arn\"=\"LAMBDA_ARN\"\n```\n\n## 5. 이미지 업데이트 시\n```bash\naws lambda update-function-code \\\n  --function-name LAMBDA_NAME \\\n  --image-uri ECR이미지경로\n```\n\n## 6. 람다함수 환경변수 교체 시\n```bash\naws lambda update-function-configuration \\\n  --function-name LAMBDA_NAME \\\n  --environment \"Variables={KEY1=VAL1,KEY2=VAL2,....}\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscanf-s%2Fgithub-autofollow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscanf-s%2Fgithub-autofollow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscanf-s%2Fgithub-autofollow/lists"}