diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml new file mode 100644 index 0000000..ad96f82 --- /dev/null +++ b/.github/workflows/blank.yml @@ -0,0 +1,36 @@ +# This is a basic workflow to help you get started with Actions + +name: test + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. diff --git a/.github/workflows/copybara.action.yml b/.github/workflows/copybara.action.yml new file mode 100644 index 0000000..7dfcd32 --- /dev/null +++ b/.github/workflows/copybara.action.yml @@ -0,0 +1,34 @@ +name: Copybara Sync + +on: + workflow_dispatch: # manual trigger + push: + branches: ["main"] # auto-trigger on changes + +jobs: + run-copybara: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install JDK + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + + - name: Download Copybara + run: curl -LO https://github.com/google/copybara/releases/latest/download/copybara_deploy.jar + + - name: Set Git identity + run: | + git config --global user.name "Copybara Bot" + git config --global user.email "copybara-bot@example.com" + + - name: Run Copybara + env: + GITHUB_TOKEN: ${{ secrets.COPYBARA_GITHUB_TOKEN }} + run: | + java -jar copybara_deploy.jar copy.bara.sky github_export --init-history diff --git a/copy.bara.sky b/copy.bara.sky new file mode 100644 index 0000000..61f53d1 --- /dev/null +++ b/copy.bara.sky @@ -0,0 +1,12 @@ +core.workflow( + name = "github_export", + origin = git.origin( + url = "https://github.com/coki04/copybara.test", + ref = "main", + ), + destination = git.github_pr_destination( + url = "https://$GITHUB_TOKEN@github.com/coki04/copybara.test.dst", + destination_ref = "main", + ), + authoring = authoring.pass_thru("COPYBARA "), +) diff --git a/a b/file1.txt similarity index 100% rename from a rename to file1.txt