{"id":28437173,"url":"https://github.com/bytebase/upsert-issue-action","last_synced_at":"2025-06-14T14:38:32.877Z","repository":{"id":273319563,"uuid":"919299629","full_name":"bytebase/upsert-issue-action","owner":"bytebase","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-10T17:59:27.000Z","size":1232,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T21:48:37.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/bytebase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2025-01-20T06:18:35.000Z","updated_at":"2025-02-11T13:40:15.000Z","dependencies_parsed_at":"2025-01-20T13:45:26.401Z","dependency_job_id":null,"html_url":"https://github.com/bytebase/upsert-issue-action","commit_stats":null,"previous_names":["bytebase/actions-upsert-issue","bytebase/upsert-issue-action"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bytebase/upsert-issue-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fupsert-issue-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fupsert-issue-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fupsert-issue-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fupsert-issue-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bytebase","download_url":"https://codeload.github.com/bytebase/upsert-issue-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fupsert-issue-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259833263,"owners_count":22918871,"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","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":[],"created_at":"2025-06-05T23:09:08.568Z","updated_at":"2025-06-14T14:38:32.843Z","avatar_url":"https://github.com/bytebase.png","language":"TypeScript","readme":"# About\n\nGithub action to upsert issues on Bytebase.\n\nThis action creates or updates the Bytebase migration issue for the PR. If you\nchange the migration script during the PR process, this action will update the\ncorresponding Bytebase migration task as well. And it will return error if you\nattempt to update a migration script when the corresponding migration task has\nalready been rolled out.\n\n# Change Type\n\nThe migration files matched by `pattern` are assumed to follow a naming scheme.\nIt should start with digit version numbers, separated by underscore and end with\na change type. Example: `path/to/migrations/\u003c\u003cversion\u003e\u003e_xxxx_\u003c\u003cchangeType\u003e\u003e.sql`\nThis action determines the change type of a file by how its filename ends. The\ndefault change type is schema change.\n\n| Ends with | Type                 |\n| --------- | -------------------- |\n| ddl       | schema change        |\n| ghost     | online schema change |\n| dml       | data change          |\n\n# Inputs\n\n| Input Name   | Required | Default Value | Description                                                                                                                                                                                                                                                                                                                                                                                          | Type   |\n| ------------ | -------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |\n| github-token | Yes      | N/A           | GitHub token for accessing the API                                                                                                                                                                                                                                                                                                                                                                   | String |\n| pattern      | Yes      | `**/*.sql`    | Glob pattern to match changed files                                                                                                                                                                                                                                                                                                                                                                  | String |\n| url          | Yes      | N/A           | The Bytebase URL. Example: https://bytebase.example.com                                                                                                                                                                                                                                                                                                                                              | String |\n| token        | Yes      | N/A           | The API token obtained from bytebase/login action                                                                                                                                                                                                                                                                                                                                                    | String |\n| headers      | Yes      | N/A           | JSON string of extra headers to include in the request. e.g Cloudflare Zero Trust headers                                                                                                                                                                                                                                                                                                            | String |\n| project-id   | Yes      | N/A           | The project ID. Example: example                                                                                                                                                                                                                                                                                                                                                                     | String |\n| targets      | Yes      | N/A           | The database group or databases to deploy. Either a comma separated list of the databases or a database group. Databases example: `instances/mysql1/databases/db1,instances/mysql1/databases/db2`. Database format: instances/{instance}/databases/{database} Database group example: `projects/exa/databaseGroups/mygroup` Database group format: projects/{project}/databaseGroups/{databaseGroup} | String |\n| title        | Yes      | N/A           | The title of the issue                                                                                                                                                                                                                                                                                                                                                                               | String |\n| description  | Yes      | ``            | The description of the issue (can be empty)                                                                                                                                                                                                                                                                                                                                                          | String |\n\n## Example\n\n```yaml\nname: Upsert Migration\n\non:\n  pull_request:\n    branches:\n      - main\n    types:\n      - closed # Triggers when a pull request is closed\n\njobs:\n  bytebase-upsert-migration:\n    runs-on: ubuntu-latest\n    if: github.event.pull_request.merged == true\n    env:\n      BYTEBASE_URL: 'https://bytebase-ci.zeabur.app'\n      BYTEBASE_SERVICE_ACCOUNT: 'ci@service.bytebase.com'\n      PROJECT: 'example'\n      TARGETS: 'instances/prod-instance/databases/example'\n      ISSUE_TITLE:\n        '[${{ github.repository }}#${{ github.event.pull_request.number }}] ${{\n        github.event.pull_request.title }}'\n      DESCRIPTION:\n        'Triggered by ${{ github.event.repository.html_url }}/pull/${{\n        github.event.pull_request.number }} ${{ github.event.pull_request.title\n        }}'\n    name: Upsert Migration\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n      - name: Login to Bytebase\n        id: login\n        uses: bytebase/login-action@0.0.2\n        with:\n          bytebase-url: ${{ env.BYTEBASE_URL }}\n          service-key: ${{ env.BYTEBASE_SERVICE_ACCOUNT }}\n          service-secret: ${{ secrets.BYTEBASE_PASSWORD }}\n      - name: Upsert issue\n        id: upsert\n        uses: bytebase/upsert-issue-action@main\n        with:\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          pattern: '**/*.sql'\n          url: ${{ env.BYTEBASE_URL }}\n          token: ${{ steps.login.outputs.token }}\n          headers: '{\"Accept-Encoding\": \"deflate, gzip\"}'\n          project-id: ${{ env.PROJECT }}\n          targets: ${{ env.TARGETS }}\n          title: ${{ env.ISSUE_TITLE }}\n          description: ${{ env.DESCRIPTION }}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebase%2Fupsert-issue-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytebase%2Fupsert-issue-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebase%2Fupsert-issue-action/lists"}