{"id":12552387,"name":"lfreleng-actions/github2gerrit-action","ecosystem":"actions","description":"Creates Gerrit changes from GitHub pull requests","homepage":null,"licenses":"other","normalized_licenses":["GPL-1.0+"],"repository_url":"https://github.com/lfreleng-actions/github2gerrit-action","keywords_array":[],"namespace":"lfreleng-actions","versions_count":21,"first_release_published_at":"2025-08-28T11:27:24.000Z","latest_release_published_at":"2025-11-21T15:45:27.000Z","latest_release_number":"v1.0.1","last_synced_at":"2026-05-28T11:45:41.939Z","created_at":"2025-12-04T16:31:52.433Z","updated_at":"2026-05-28T11:45:41.939Z","registry_url":"https://github.com/lfreleng-actions/github2gerrit-action","install_command":null,"documentation_url":null,"metadata":{"name":"github2gerrit","description":"Creates Gerrit changes from GitHub pull requests","inputs":{"GERRIT_SSH_PRIVKEY_G2G":{"description":"SSH private key content used to authenticate to Gerrit","required":true},"SUBMIT_SINGLE_COMMITS":{"description":"Submit one commit at a time to the Gerrit repository","required":false,"default":"false"},"USE_PR_AS_COMMIT":{"description":"Use PR title and body as the commit message","required":false,"default":"false"},"FETCH_DEPTH":{"description":"Fetch depth for checkout","required":false,"default":"10"},"PR_NUMBER":{"description":"Pull request number to process, use 0 to process all open","required":false,"default":"0"},"GERRIT_KNOWN_HOSTS":{"description":"Known hosts entries for Gerrit SSH (single or multi-line)","required":false},"GERRIT_SSH_USER_G2G":{"description":"Gerrit SSH username; derived if not supplied explicitly","required":false,"default":""},"GERRIT_SSH_USER_G2G_EMAIL":{"description":"Gerrit user email address; derived if not supplied explicitly","required":false,"default":""},"ORGANIZATION":{"description":"GitHub organization/owner (defaults to repo owner)","required":false,"default":"${{ github.repository_owner }}"},"REVIEWERS_EMAIL":{"description":"Comma-separated list of reviewer emails (optional)","required":false,"default":""},"ALLOW_GHE_URLS":{"description":"Allow GitHub Enterprise URLs in direct URL mode","required":false,"default":"false"},"PRESERVE_GITHUB_PRS":{"description":"Do not close GitHub PRs after pushing to Gerrit","required":false,"default":"true"},"CLOSE_MERGED_PRS":{"description":"Close GitHub PRs when corresponding Gerrit changes are merged","required":false,"default":"true"},"DRY_RUN":{"description":"Validate settings/PR metadata; do not write to Gerrit","required":false,"default":"false"},"ALLOW_DUPLICATES":{"description":"Allow submitting duplicate changes without error","required":false,"default":"false"},"CI_TESTING":{"description":"Enable CI testing mode; overrides .gitreview, creates orphan commits","required":false,"default":"false"},"FORCE":{"description":"Force PR closure regardless of Gerrit change status (abandoned, etc)","required":false,"default":"false"},"ISSUE_ID":{"description":"Issue ID to include (e.g., ABC-123)","required":false,"default":""},"USE_LOCAL_ACTION":{"description":"Use local repository action/code instead of the PyPI package. Set to 'true' when testing changes in a fork or branch before merging.","required":false,"default":"false"},"G2G_USE_SSH_AGENT":{"description":"Use SSH agent for authentication instead of file-based keys (recommended)","required":false,"default":"true"},"DUPLICATE_TYPES":{"description":"Comma-separated Gerrit states for evaluating duplicates","required":false,"default":"open"},"NORMALISE_COMMIT":{"description":"Normalize commit messages to conventional commit format","required":false,"default":"false"},"VERBOSE":{"description":"Enable verbose output (sets log level to DEBUG)","required":false,"default":"false"},"GERRIT_SERVER":{"description":"Gerrit server hostname; derived if not supplied explicitly","required":false,"default":""},"GERRIT_SERVER_PORT":{"description":"Gerrit serverSSH TCP/port","required":false,"default":"29418"},"GERRIT_PROJECT":{"description":"Gerrit project; optional if .gitreview exists","required":false,"default":""},"GERRIT_HTTP_BASE_PATH":{"description":"Optional HTTP base path for Gerrit REST (e.g. /r)","required":false,"default":""},"GERRIT_HTTP_USER":{"description":"Optional Gerrit HTTP user (for REST authenticated checks)","required":false,"default":""},"GERRIT_HTTP_PASSWORD":{"description":"Optional Gerrit HTTP password/token (for REST authentication)","required":false,"default":""},"ISSUE_ID_LOOKUP_JSON":{"description":"JSON array mapping GitHub actors to Issue IDs (format: [{\"key\": \"username\", \"value\": \"ISSUE-ID\"}])","required":false,"default":"[]"},"AUTOMATION_ONLY":{"description":"Only accept pull requests from known automation tools","required":false,"default":"true"}},"outputs":{"gerrit_change_request_url":{"description":"Gerrit change URL(s) (newline-separated if multiple)","value":"${{ steps.capture-outputs.outputs.gerrit_change_request_url }}"},"gerrit_change_request_num":{"description":"Gerrit change number(s) (newline-separated if multiple)","value":"${{ steps.capture-outputs.outputs.gerrit_change_request_num }}"},"gerrit_commit_sha":{"description":"Patch set commit sha(s) (newline-separated if multiple)","value":"${{ steps.capture-outputs.outputs.gerrit_commit_sha }}"}},"runs":{"using":"composite","steps":[{"name":"Setup Python","uses":"actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c","with":{"python-version-file":"${{ github.action_path }}/pyproject.toml"}},{"name":"Setup uv","uses":"astral-sh/setup-uv@5a7eac68fb9809dea845d802897dc5c723910fa3","with":{"enable-cache":false}},{"name":"Checkout repository","uses":"actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd","with":{"fetch-depth":"${{ inputs.FETCH_DEPTH }}","ref":"${{ github.event.pull_request.head.sha || github.sha }}"}},{"name":"Setup github2gerrit","shell":"bash","run":"# Setup github2gerrit\nset -euo pipefail\nuv --version\n# Install locally for self-testing, use uvx for external repos\nif [[ \"${{ inputs.USE_LOCAL_ACTION }}\" == \"true\" ]] || \\\n   [[ \"${{ github.repository }}\" =~ lfreleng-actions/github2gerrit-action ]]; then\n  echo \"Installing with: uv pip install --system ${{ github.action_path }}\"\n  uv pip install --system ${{ github.action_path }}\nelse\n  echo \"uvx will install GitHub2Gerrit from PyPI\"\nfi\n"},{"name":"Validate PR_NUMBER usage","if":"${{ github.event_name != 'workflow_dispatch' \u0026\u0026 inputs.PR_NUMBER != '' \u0026\u0026 inputs.PR_NUMBER != '0' }}","shell":"bash","run":"# Validate PR_NUMBER usage\nset -euo pipefail\necho \"Error: PR_NUMBER only valid during workflow_dispatch events.\"\nexit 2\n"},{"name":"Normalize PR_NUMBER","if":"${{ github.event_name == 'workflow_dispatch' }}","shell":"bash","run":"# Normalize PR_NUMBER\nset -euo pipefail\npr_in=\"${{ inputs.PR_NUMBER }}\"\nif [[ -z \"${pr_in}\" || \"${pr_in}\" == \"null\" ]]; then\n  pr_in=\"0\"\nfi\nif ! [[ \"${pr_in}\" =~ ^[0-9]+$ ]]; then\n  echo \"Error: PR_NUMBER must be a numeric value\"\n  exit 2\nfi\nif [[ \"${pr_in}\" == \"0\" ]]; then\n  echo \"SYNC_ALL_OPEN_PRS=true\" \u003e\u003e \"$GITHUB_ENV\"\nelse\n  echo \"PR_NUMBER=${pr_in}\" \u003e\u003e \"$GITHUB_ENV\"\nfi\n"},{"name":"Extract PR number, validate context","shell":"bash","run":"# Extract PR number, validate context\nset -euo pipefail\n\n# Push events don't need PR_NUMBER (used for closing merged PRs)\n# The CLI handles push events specially via _process_close_merged_prs()\nif [[ \"${{ github.event_name }}\" == \"push\" ]]; then\n  echo \"Push event detected - will process merged commits for PR closure\"\n  # Set PR_NUMBER to empty to indicate this is intentional for push events\n  echo \"PR_NUMBER=\" \u003e\u003e \"$GITHUB_ENV\"\n  exit 0\nfi\n\n# Honor PR_NUMBER or SYNC_ALL_OPEN_PRS set by workflow_dispatch\nif [[ \"${{ github.event_name }}\" == \"workflow_dispatch\" ]]; then\n  if [[ -n \"${SYNC_ALL_OPEN_PRS:-}\" ]]; then\n    echo \"Processing all open pull requests via workflow_dispatch.\"\n  else\n    if [[ -z \"${PR_NUMBER:-}\" || \"${PR_NUMBER}\" == \"null\" ]]; then\n      echo \"Error: provide PR_NUMBER or set 0 to process all PRs.\"\n      exit 2\n    fi\n    echo \"PR_NUMBER=${PR_NUMBER}\" \u003e\u003e \"$GITHUB_ENV\"\n  fi\nelse\n  PR_NUMBER_EVT=\"${{ github.event.pull_request.number || github.event.issue.number || '' }}\"\n  # Do not override PR_NUMBER if previously set\n  if [[ -z \"${PR_NUMBER:-}\" ]]; then\n    PR_NUMBER=\"${PR_NUMBER_EVT}\"\n    echo \"PR_NUMBER=${PR_NUMBER}\" \u003e\u003e \"$GITHUB_ENV\"\n  fi\n  if [[ -z \"${PR_NUMBER}\" || \"${PR_NUMBER}\" == \"null\" ]]; then\n    echo \"Error: PR_NUMBER is empty.\"\n    echo \"This action requires a valid pull request context.\"\n    echo \"Current event: ${{ github.event_name }}\"\n    exit 2\n  fi\nfi\n"},{"name":"Run github2gerrit Python CLI","id":"run-cli","shell":"bash","env":{"GITHUB_TOKEN":"${{ github.token }}","SUBMIT_SINGLE_COMMITS":"${{ inputs.SUBMIT_SINGLE_COMMITS }}","USE_PR_AS_COMMIT":"${{ inputs.USE_PR_AS_COMMIT }}","FETCH_DEPTH":"${{ inputs.FETCH_DEPTH }}","GERRIT_KNOWN_HOSTS":"${{ inputs.GERRIT_KNOWN_HOSTS }}","GERRIT_SSH_PRIVKEY_G2G":"${{ inputs.GERRIT_SSH_PRIVKEY_G2G }}","GERRIT_SSH_USER_G2G":"${{ inputs.GERRIT_SSH_USER_G2G }}","GERRIT_SSH_USER_G2G_EMAIL":"${{ inputs.GERRIT_SSH_USER_G2G_EMAIL }}","ORGANIZATION":"${{ inputs.ORGANIZATION }}","REVIEWERS_EMAIL":"${{ inputs.REVIEWERS_EMAIL }}","ALLOW_GHE_URLS":"${{ inputs.ALLOW_GHE_URLS }}","PRESERVE_GITHUB_PRS":"${{ inputs.PRESERVE_GITHUB_PRS }}","DRY_RUN":"${{ inputs.DRY_RUN }}","ALLOW_DUPLICATES":"${{ inputs.ALLOW_DUPLICATES }}","ISSUE_ID":"${{ inputs.ISSUE_ID }}","ISSUE_ID_LOOKUP_JSON":"${{ inputs.ISSUE_ID_LOOKUP_JSON }}","CI_TESTING":"${{ inputs.CI_TESTING }}","CLOSE_MERGED_PRS":"${{ inputs.CLOSE_MERGED_PRS }}","FORCE":"${{ inputs.FORCE }}","DUPLICATE_TYPES":"${{ inputs.DUPLICATE_TYPES }}","NORMALISE_COMMIT":"${{ inputs.NORMALISE_COMMIT }}","G2G_USE_SSH_AGENT":"${{ inputs.G2G_USE_SSH_AGENT }}","G2G_VERBOSE":"${{ inputs.VERBOSE }}","AUTOMATION_ONLY":"${{ inputs.AUTOMATION_ONLY }}","GERRIT_SERVER":"${{ inputs.GERRIT_SERVER }}","GERRIT_SERVER_PORT":"${{ inputs.GERRIT_SERVER_PORT }}","GERRIT_PROJECT":"${{ inputs.GERRIT_PROJECT }}","GERRIT_HTTP_BASE_PATH":"${{ inputs.GERRIT_HTTP_BASE_PATH }}","GERRIT_HTTP_USER":"${{ inputs.GERRIT_HTTP_USER }}","GERRIT_HTTP_PASSWORD":"${{ inputs.GERRIT_HTTP_PASSWORD }}","GITHUB_EVENT_NAME":"${{ github.event_name }}","GITHUB_REPOSITORY":"${{ github.repository }}","GITHUB_REPOSITORY_OWNER":"${{ github.repository_owner }}","GITHUB_SERVER_URL":"${{ github.server_url }}","GITHUB_RUN_ID":"${{ github.run_id }}","GITHUB_SHA":"${{ github.sha }}","GITHUB_BASE_REF":"${{ github.base_ref }}","GITHUB_HEAD_REF":"${{ github.head_ref }}","GITHUB_ACTOR":"${{ github.actor }}","SYNC_ALL_OPEN_PRS":"${{ env.SYNC_ALL_OPEN_PRS }}","PR_NUMBER":"${{ env.PR_NUMBER }}","G2G_TEST_MODE":"false"},"run":"# Run github2gerrit Python CLI\nset -euo pipefail\n# Use different invocation methods based on repository or USE_LOCAL_ACTION flag\nif [[ \"${{ inputs.USE_LOCAL_ACTION }}\" == \"true\" ]] || \\\n   [[ \"${{ github.repository }}\" =~ lfreleng-actions/github2gerrit-action ]]; then\n  echo \"Running:python -m github2gerrit.cli\"\n  python -m github2gerrit.cli\nelse\n  echo \"Running: uvx --from github2gerrit github2gerrit\"\n  uvx --from github2gerrit github2gerrit\nfi\n"},{"name":"Capture outputs","id":"capture-outputs","shell":"bash","run":"# Capture outputs\nset -euo pipefail\n# Use GitHub Actions multiline output format\n{\n  echo \"gerrit_change_request_url\u003c\u003cG2G\"\n  printf '%s\\n' \"${GERRIT_CHANGE_REQUEST_URL:-}\"\n  echo \"G2G\"\n  echo \"gerrit_change_request_num\u003c\u003cG2G\"\n  printf '%s\\n' \"${GERRIT_CHANGE_REQUEST_NUM:-}\"\n  echo \"G2G\"\n  echo \"gerrit_commit_sha\u003c\u003cG2G\"\n  printf '%s\\n' \"${GERRIT_COMMIT_SHA:-}\"\n  echo \"G2G\"\n} \u003e\u003e \"$GITHUB_OUTPUT\"\n"}]},"default_branch":"main","path":null},"repo_metadata":{"id":311604568,"uuid":"1043645675","full_name":"lfreleng-actions/github2gerrit-action","owner":"lfreleng-actions","description":"Python tool for converting Github pull requests to Gerrit changes, with GitHub action wrapper","archived":false,"fork":false,"pushed_at":"2025-11-26T10:31:52.000Z","size":1349,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-28T07:10:47.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lfreleng-actions.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-24T10:12:10.000Z","updated_at":"2025-11-24T20:07:14.000Z","dependencies_parsed_at":"2025-09-17T15:08:33.204Z","dependency_job_id":"c2b28f4b-5aee-4c77-a679-6e81dfb307d0","html_url":"https://github.com/lfreleng-actions/github2gerrit-action","commit_stats":null,"previous_names":["lfreleng-actions/github2gerrit","lfreleng-actions/github2gerrit-action"],"tags_count":21,"template":false,"template_full_name":"lfreleng-actions/actions-template","purl":"pkg:github/lfreleng-actions/github2gerrit-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfreleng-actions%2Fgithub2gerrit-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfreleng-actions%2Fgithub2gerrit-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfreleng-actions%2Fgithub2gerrit-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfreleng-actions%2Fgithub2gerrit-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lfreleng-actions","download_url":"https://codeload.github.com/lfreleng-actions/github2gerrit-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfreleng-actions%2Fgithub2gerrit-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27472814,"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-12-03T02:00:06.367Z","response_time":57,"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"}},"repo_metadata_updated_at":"2025-12-04T16:35:38.020Z","dependent_packages_count":0,"downloads":null,"downloads_period":null,"dependent_repos_count":0,"rankings":{"downloads":null,"dependent_repos_count":7.15878127322269,"dependent_packages_count":0.0,"stargazers_count":null,"forks_count":null,"docker_downloads_count":null,"average":3.579390636611345},"purl":"pkg:githubactions/lfreleng-actions/github2gerrit-action","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/actions/lfreleng-actions/github2gerrit-action","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/actions/lfreleng-actions/github2gerrit-action","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/actions/lfreleng-actions/github2gerrit-action/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":null,"versions_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/lfreleng-actions%2Fgithub2gerrit-action/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/lfreleng-actions%2Fgithub2gerrit-action/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/lfreleng-actions%2Fgithub2gerrit-action/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/lfreleng-actions%2Fgithub2gerrit-action/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/lfreleng-actions%2Fgithub2gerrit-action/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/github%20actions/packages/lfreleng-actions%2Fgithub2gerrit-action/codemeta","maintainers":[]}