{"id":27977261,"url":"https://github.com/magicjar/abp-localization-sync","last_synced_at":"2025-08-31T21:43:31.905Z","repository":{"id":274040480,"uuid":"921668413","full_name":"magicjar/abp-localization-sync","owner":"magicjar","description":"ABP Localization Sync is a GitHub Action designed to help users of the ABP.IO framework synchronize their localization data with Google Sheets. This action allows you to push JSON localization files to Google Sheets and pull data from Google Sheets to update your JSON localization files.","archived":false,"fork":false,"pushed_at":"2025-02-02T12:24:28.000Z","size":2610,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T01:47:54.919Z","etag":null,"topics":["abp-framework","google-sheets","localization","management","tool"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magicjar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["magicjar"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2025-01-24T11:41:38.000Z","updated_at":"2025-02-02T12:24:31.000Z","dependencies_parsed_at":"2025-05-08T01:48:00.498Z","dependency_job_id":"cae73318-2f13-4803-90a9-98b886902e44","html_url":"https://github.com/magicjar/abp-localization-sync","commit_stats":null,"previous_names":["magicjar/abp-localization-sync"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/magicjar/abp-localization-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicjar%2Fabp-localization-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicjar%2Fabp-localization-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicjar%2Fabp-localization-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicjar%2Fabp-localization-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicjar","download_url":"https://codeload.github.com/magicjar/abp-localization-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicjar%2Fabp-localization-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273046461,"owners_count":25036179,"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-08-31T02:00:09.071Z","response_time":79,"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":["abp-framework","google-sheets","localization","management","tool"],"created_at":"2025-05-08T01:47:51.120Z","updated_at":"2025-08-31T21:43:31.846Z","avatar_url":"https://github.com/magicjar.png","language":"C#","funding_links":["https://github.com/sponsors/magicjar"],"categories":[],"sub_categories":[],"readme":"# ABP Localization Sync GitHub Action\n\nThis GitHub Action helps users of the ABP.IO framework to sync their localization data to and from Google Sheets.\n\n## Inputs\n\n- `action`: Specify `push` to push data to Google Sheets or `pull` to pull data from Google Sheets. Default is `push`.\n- `google_api_key_json`: Google API Key JSON.\n- `spreadsheet_id`: Google Sheets Spreadsheet ID.\n- `localization_root`: Root directory for localization files.\n\n## Usage\n\n### Push JSON to Google Sheets\n\nCreate a workflow file (e.g., `.github/workflows/localization-push.yml`) with the following content:\n\n```yaml\nname: Localization Push\n\non:\n  workflow_dispatch:\n\njobs:\n  sync_localizations:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v4\n\n      - name: Set up Node.js\n        uses: actions/setup-node@v4\n        with:\n          node-version: 20\n\n      - name: Push JSON to Google Sheets\n        uses: magicjar/abp-localization-sync@v1\n        with:\n          action: push\n          google_api_key_json: ${{ secrets.GOOGLE_API_KEY_JSON }}\n          spreadsheet_id: ${{ vars.SPREADSHEET_ID }}\n          localization_root: ./src/Acme.BookStore.Domain.Shared/Localization\n```\n\n### Pull Google Sheets to JSON\n\nCreate a workflow file (e.g., `.github/workflows/localization-pull.yml`) with the following content:\n\n```yaml\nname: Localization Pull\n\non:\n  workflow_dispatch:\n\njobs:\n  sync_localizations:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v4\n\n      - name: Set up Node.js\n        uses: actions/setup-node@v4\n        with:\n          node-version: 20\n\n      - name: Pull Google Sheets to JSON\n        uses: magicjar/abp-localization-sync@v1\n        with:\n          action: pull\n          google_api_key_json: ${{ secrets.GOOGLE_API_KEY_JSON }}\n          spreadsheet_id: ${{ vars.SPREADSHEET_ID }}\n          localization_root: ./src/Acme.BookStore.Domain.Shared/Localization\n\n      - name: Add localization files\n        run: git add src/Acme.BookStore.Domain.Shared/Localization/**/*.json\n\n      - name: Commit changes\n        run: |\n          git config user.name \"GitHub Actions\"\n          git config user.email \"actions@github.com\"\n          if git diff-index --quiet HEAD; then\n            echo \"No changes to commit\"\n          else\n            git commit -m \"Updated localizations from Google Sheets\"\n            git push\n          fi\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\n## Secrets and Variables\n\nMake sure to add the following secrets and variables in your GitHub repository settings:\n\n- `GOOGLE_API_KEY_JSON`: The content of your Google API key JSON file.\n- `SPREADSHEET_ID`: The ID of your Google Sheets spreadsheet.\n- `GITHUB_TOKEN`: The GitHub token for committing changes (automatically provided by GitHub Actions).\n\nTo create a `google-api-key.json` file, follow these steps to generate a Google Cloud service account key for your project. This key will be used to authenticate API requests, such as those made to Google Sheets.\n\n\n## Steps to Create `google-api-key.json`\n\n### 1. Set Up a Google Cloud Project\n1. Go to the [Google Cloud Console](https://console.cloud.google.com/).\n2. If you don’t have an existing project, create one:\n   - Click the dropdown at the top-left corner of the console and select **\"New Project\"**.\n   - Enter a name for your project and click **\"Create\"**.\n\n### 2. Enable the Google Sheets API\n1. In the Google Cloud Console, navigate to **APIs \u0026 Services** → **Library**.\n2. Search for **Google Sheets API** and click on it.\n3. Click **Enable** to activate the API for your project.\n\n### 3. Create a Service Account\n1. Go to **APIs \u0026 Services** → **Credentials** in the Google Cloud Console.\n2. Click **Create Credentials** → **Service Account**.\n3. Fill out the service account details:\n   - **Name**: Choose a descriptive name (e.g., `SheetsServiceAccount`).\n   - **Description**: Optional but recommended.\n   - Click **Create and Continue**.\n\n4. Assign a role to the service account:\n   - For Google Sheets, the recommended role is **Editor**.\n   - Click **Continue** → **Done**.\n\n### 4. Generate a JSON Key File\n1. After creating the service account, go back to **APIs \u0026 Services** → **Credentials**.\n2. Find the service account you just created in the **Service Accounts** section.\n3. Click on the service account name to open its details.\n4. Go to the **Keys** tab and click **Add Key** → **Create New Key**.\n5. Choose **JSON** as the key type and click **Create**.\n6. A JSON file will be downloaded to your computer. This is your `google-api-key.json`.\n\n### 5. Share Your Google Sheet with the Service Account **(Important)**\n1. Open the Google Sheet you want to access.\n2. Share it with the email address of the service account (found in the JSON file under the `client_email` field).\n3. Grant the service account **Editor** or **Viewer** access, depending on your needs.\n\n## Running Tests\n\nTo run the tests, follow these steps:\n\n1. Install the dependencies:\n   ```sh\n   npm install\n   ```\n\n2. Run the tests:\n   ```sh\n   npm test\n   ```\n\nThis will execute all the test files in the `__tests__` directory using Jest.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicjar%2Fabp-localization-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicjar%2Fabp-localization-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicjar%2Fabp-localization-sync/lists"}