From 22d347ab7b76306dcf2be53b86822459b4ecf07b Mon Sep 17 00:00:00 2001 From: coleramos425 Date: Mon, 30 Jan 2023 13:28:54 -0600 Subject: [PATCH] Add new action for syncing changes to internal repo Signed-off-by: coleramos425 [ROCm/rocprofiler-compute commit: 79762b18cee03a45b3aa01d96fffab8805c426ac] --- .../.github/workflows/update-repo.yml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 projects/rocprofiler-compute/.github/workflows/update-repo.yml diff --git a/projects/rocprofiler-compute/.github/workflows/update-repo.yml b/projects/rocprofiler-compute/.github/workflows/update-repo.yml new file mode 100644 index 0000000000..f5680ce172 --- /dev/null +++ b/projects/rocprofiler-compute/.github/workflows/update-repo.yml @@ -0,0 +1,59 @@ +name: Update AARInternal + +on: + push: + branches: [ main ] + +jobs: + copy-files: + runs-on: ubuntu-latest + steps: + - name: Checkout current repo + uses: actions/checkout@v3 + with: + path: 'src' + ref: 'main' + persist-credentials: false + + - name: Checkout dest repo + uses: actions/checkout@v3 + with: + path: 'dest' + ref: 'main' + repository: 'AARInternal/omniperf' + token: ${{ secrets.GH_PAT }} + fetch-depth: 0 + persist-credentials: true + + - name: Copy common files to dest repo + shell: bash + run: | + rm -rf dest/* + cp -rv src/* dest/ + + - name: Check for new files + id: newFiles + shell: bash + working-directory: dest + run: | + pwd + ls + echo $(git status) + git add -A + git status --porcelain | wc -l + if [[ $(git status --porcelain | wc -l) -gt 0 ]] + then + echo "::set-output name=hasNewFiles::true" + else + echo "::set-output name=hasNewFiles::false" + fi + - name: Push new files + if: ${{ steps.newFiles.outputs.hasNewFiles == 'true' }} + shell: bash + working-directory: dest + run: | + git config --global user.name "${{ secrets.USER_NAME }}" + git config --global user.email "${{ secrets.USER_EMAIL }}" + git commit -m "maint: Updated common files from ref: ${{ github.ref }}" + git push +