# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

name: Mirror flutter/flutter master branch to main

on:
  push:
    branches:
      - 'master'

# Declare default permissions as read only.
permissions: read-all

jobs:
  mirror_job:
    permissions:
      pull-requests: write
    runs-on: ubuntu-latest
    if: ${{ github.repository == 'flutter/flutter' }}
    name: Mirror master branch to main branch
    steps:
      - name: Mirror action step
        id: mirror
        # google/mirror-branch-action is a secure Google-managed action.
        # Although the repository is archived, it is the standard and trusted tool used for mirroring master to main in this project.
        uses: google/mirror-branch-action@30c52ee21f5d3bd7fb28b95501c11aae7f17eebb # zizmor: ignore[archived-uses]
        with:
          github-token: ${{ secrets.FLUTTERMIRRORINGBOT_TOKEN }}
          source: 'master'
          dest: 'main'