Skip to content

Bump lfreleng-actions/security-workflows/.github/workflows/sonatype-lifecycle.yaml from 0.5.0 to 0.7.0 #162

Bump lfreleng-actions/security-workflows/.github/workflows/sonatype-lifecycle.yaml from 0.5.0 to 0.7.0

Bump lfreleng-actions/security-workflows/.github/workflows/sonatype-lifecycle.yaml from 0.5.0 to 0.7.0 #162

---

Check warning on line 1 in .github/workflows/call-github2gerrit.yaml

View workflow run for this annotation

GitHub Actions / GitHub2Gerrit

Workflow execution policy warning (evaluate mode)

On November 2, 2026, GitHub will restrict `pull_request_target` on public repositories by default. To continue allowing the event trigger, configure an Actions policy. Learn more: https://gh.io/securely-using-pull_request_target#default-policy-for-pull_request_target
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 The Linux Foundation
name: "GitHub2Gerrit"
# Thin caller for the github2gerrit reusable workflow. All processing
# lives in the canonical reusable workflow; this caller only wires up
# the triggers, forwards the Gerrit-event dispatch context, and passes
# the repository authentication inputs/secret.
# yamllint disable-line rule:truthy
on:
# Mirror new/updated GitHub pull requests to Gerrit.
# github2gerrit fundamentally requires pull_request_target so the
# mirror job can read repository secrets (the Gerrit SSH key) and
# write PR comments/labels. Fork PR code is never checked out or
# executed here, so the usual pull_request_target risk is avoided.
pull_request_target: # zizmor: ignore[dangerous-triggers]
types: [opened, reopened, edited, synchronize, closed]
branches:
- main
- master
# Close GitHub PRs whose Gerrit changes have merged
push:
branches:
- main
- master
# Manual runs and Gerrit-event dispatches (gerrit_to_platform)
workflow_dispatch:
inputs:
PR_NUMBER:
description: "PR number to process; 0 processes all open"
required: false
default: "0"
type: string
GERRIT_CHANGE_URL:
description: "Gerrit change URL from a Gerrit event dispatch"
required: false
type: string
GERRIT_EVENT_TYPE:
description: "Gerrit event type (e.g. change-merged)"
required: false
type: string
GERRIT_BRANCH:
description: "Target branch override from a Gerrit event dispatch"
required: false
type: string
ALLOW_DUPLICATES:
description: "Allow submitting duplicate changes without error"
required: false
default: true
type: boolean
PRESERVE_GITHUB_PRS:
description: "Do not close GitHub PRs after pushing to Gerrit"
required: false
default: true
type: boolean
# Default to no permissions; the job grants only what it needs.
permissions: {}
jobs:
github2gerrit:
permissions:
contents: read # read repository content for the mirror job
pull-requests: write # comment on and close mirrored PRs
issues: write # manage PR/issue metadata during mirroring
# yamllint disable-line rule:line-length
uses: lfreleng-actions/github2gerrit-action/.github/workflows/github2gerrit.yaml@3d548cc0cd8e04175da73a7dc3449b312ce67e07 # v2.1.0
with:
USE_PR_AS_COMMIT: true
GERRIT_KNOWN_HOSTS: ${{ vars.GERRIT_KNOWN_HOSTS }}
GERRIT_SSH_USER_G2G: ${{ vars.GERRIT_SSH_USER_G2G }}
GERRIT_SSH_USER_G2G_EMAIL: ${{ vars.GERRIT_SSH_USER_G2G_EMAIL }}
ISSUE_ID_LOOKUP_JSON: ${{ vars.ISSUE_ID_LOOKUP_JSON || '[]' }}
PR_NUMBER: ${{ inputs.PR_NUMBER || '0' }}
GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL || '' }}
GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE || '' }}
GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH || '' }}
# yamllint disable-line rule:line-length
ALLOW_DUPLICATES: ${{ github.event_name != 'workflow_dispatch' || inputs.ALLOW_DUPLICATES }}
# yamllint disable-line rule:line-length
PRESERVE_GITHUB_PRS: ${{ github.event_name != 'workflow_dispatch' || inputs.PRESERVE_GITHUB_PRS }}
secrets:
GERRIT_SSH_PRIVKEY_G2G: ${{ secrets.GERRIT_SSH_PRIVKEY_G2G }}