name: Create Release Pull Request on: workflow_call: inputs: checkout-base-branch: required: true type: string description: 'The base branch, tag, or SHA for git operations.' release-pr-base-branch: required: true type: string description: 'The base branch, tag, or SHA for the release pull request.' semver-version: required: true type: string description: 'A semantic version. eg: x.x.x' mobile-build-version: required: false type: string description: 'The build version for the mobile platform.' previous-version-ref: required: true type: string description: 'Previous release version tag or branch name. eg: v7.7.0' # Flag to indicate if the release is a test release for development purposes only mobile-template-sheet-id: required: false type: string description: 'The Mobile testing sheet template id.' default: '1012668681' # prod sheet template extension-template-sheet-id: required: false type: string description: 'The Extension testing sheet template id.' default: '295804563' # prod sheet template test-only: required: false type: string description: 'If true, the release will be marked as a test release.' default: 'false' # possible values are [ mobile, extension ] release-sheet-google-document-id: required: false type: string description: 'The Google Document ID for the release notes.' default: '1tsoodlAlyvEUpkkcNcbZ4PM9HuC9cEM80RZeoVv5OCQ' # Prod Release Document platform: required: true type: string description: 'The platform for which the release PR is being created.' github-tools-version: type: string description: 'The version of github-tools to use. Defaults to main.' default: 'main' git-user-name: type: string description: 'Git user name for commits. Defaults to metamaskbot.' default: 'metamaskbot' git-user-email: type: string description: 'Git user email for commits. Defaults to metamaskbot@users.noreply.github.com.' default: 'metamaskbot@users.noreply.github.com' secrets: github-token: required: true description: 'GitHub token used for authentication.' google-application-creds-base64: required: true description: 'Google application credentials base64 encoded.' jobs: create-release-pr: name: Create Release Pull Request runs-on: ubuntu-latest permissions: contents: write pull-requests: write steps: # Step 1: Checkout invoking repository (metamask-mobile | metamask-extension ) - name: Checkout invoking repository uses: actions/checkout@v4 with: fetch-depth: 0 ref: ${{ inputs.checkout-base-branch }} token: ${{ secrets.github-token }} # Step 2: Checkout github-tools repository - name: Checkout github-tools repository uses: actions/checkout@v4 with: repository: MetaMask/github-tools ref: ${{ inputs.github-tools-version }} path: github-tools # Step 3: Setup environment from github-tools - name: Checkout and setup environment uses: ./github-tools/.github/actions/checkout-and-setup with: is-high-risk-environment: true # Step 4: Print Input Values - name: Print Input Values run: | echo "Input Values:" echo "-------------" echo "Platform: ${{ inputs.platform }}" echo "Checkout Base Branch: ${{ inputs.checkout-base-branch }}" echo "Release PR Base Branch: ${{ inputs.release-pr-base-branch }}" echo "Semver Version: ${{ inputs.semver-version }}" echo "Previous Version Reference: ${{ inputs.previous-version-ref }}" echo "Test Only Mode: ${{ inputs.test-only }}" if [[ "${{ inputs.platform }}" == "mobile" ]]; then echo "Mobile Build Version: ${{ inputs.mobile-build-version }}" fi echo "Mobile Template Sheet ID: ${{ inputs.mobile-template-sheet-id }}" echo "Extension Template Sheet ID: ${{ inputs.extension-template-sheet-id }}" echo "Release Sheet Google Document ID: ${{ inputs.release-sheet-google-document-id }}" echo "GitHub Tools Version: ${{ inputs.github-tools-version }}" echo "Git User Name: ${{ inputs.git-user-name }}" echo "Git User Email: ${{ inputs.git-user-email }}" echo "-------------" # Step 5: Create Release PR - name: Create Release PR id: create-release-pr shell: bash env: GITHUB_TOKEN: ${{ secrets.github-token }} BASE_BRANCH: ${{ inputs.release-pr-base-branch }} GITHUB_REPOSITORY_URL: '${{ github.server_url }}/${{ github.repository }}' TEST_ONLY: ${{ inputs.test-only }} GOOGLE_DOCUMENT_ID: ${{ inputs.release-sheet-google-document-id }} GOOGLE_APPLICATION_CREDENTIALS_BASE64: ${{ secrets.google-application-creds-base64 }} NEW_VERSION: ${{ inputs.semver-version }} MOBILE_TEMPLATE_SHEET_ID: ${{ inputs.mobile-template-sheet-id }} EXTENSION_TEMPLATE_SHEET_ID: ${{ inputs.extension-template-sheet-id }} working-directory: ${{ github.workspace }} run: | # Execute the script from github-tools ./github-tools/.github/scripts/create-platform-release-pr.sh \ ${{ inputs.platform }} \ ${{ inputs.previous-version-ref }} \ ${{ inputs.semver-version }} \ ${{ inputs.mobile-build-version }} \ ${{ inputs.git-user-name }} \ ${{ inputs.git-user-email }}