From e6385750847494739e90db11bddf5372544b9100 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Tue, 7 Dec 2021 15:21:41 -0500 Subject: [PATCH] Add a testing version of sync GHA (#344) * Add a testing version of sync GHA * Try to fix spacing in on: * Oh problem was no dash is needed * Try to specify config path better --- .github/test-sync.yml | 50 +++++++++++++++++++ ...mechanics-updates.yml => send-updates.yml} | 0 .github/workflows/starting-course.yml | 6 ++- .github/workflows/test-send-updates.yml | 40 +++++++++++++++ 4 files changed, 94 insertions(+), 2 deletions(-) create mode 100755 .github/test-sync.yml rename .github/workflows/{downstream-mechanics-updates.yml => send-updates.yml} (100%) create mode 100644 .github/workflows/test-send-updates.yml diff --git a/.github/test-sync.yml b/.github/test-sync.yml new file mode 100755 index 00000000..9373e6f2 --- /dev/null +++ b/.github/test-sync.yml @@ -0,0 +1,50 @@ +# Candace Savonen Aug 2021 +# For info on how to update this file see: https://github.com/marketplace/actions/repo-file-sync-action#%EF%B8%8F-sync-configuration + +group: + # Repositories to recieve changes + repos: | + https://github.com/jhudsl/DaSL_Template_Sync_Test + +###ADD NEW REPO HERE following the format above# + files: + - source: .github/workflows/render-bookdown.yml + dest: .github/workflows/render-bookdown.yml + - source: .github/workflows/render-preview.yml + dest: .github/workflows/render-preview.yml + - source: .github/workflows/docker-build-test.yml + dest: .github/workflows/docker-build-test.yml + - source: .github/workflows/transfer-rendered-files.yml + dest: .github/workflows/transfer-rendered-files.yml + - source: .github/workflows/style-and-sp-check.yml + dest: .github/workflows/style-and-sp-check.yml + - source: .github/workflows/url-checker.yml + dest: .github/workflows/url-checker.yml + - source: .github/workflows/release-notes.yml + dest: .github/workflows/release-notes.yml + - source: .github/workflows/delete-preview.yml + dest: .github/workflows/delete-preview.yml + - source: .github/ISSUE_TEMPLATE/course-problem-report.md + dest: .github/ISSUE_TEMPLATE/course-problem-report.md + - source: .github/ISSUE_TEMPLATE/course-content-add.md + dest: .github/ISSUE_TEMPLATE/course-content-add.md + - source: scripts/spell-check.R + dest: scripts/spell-check.R + - source: scripts/git_repo_check.R + dest: scripts/git_repo_check.R + - source: code_of_conduct.md + dest: code_of_conduct.md + +###### TO ADD NEW REPOSITORY USE THIS FORMAT; Feel free to add/drop files that +# you specifically would like synced (or not). +# +# # Repositories to receive changes +# repos: | +# org/repo_name +# # Files which should be updated +# - source: .github/workflows/ + # dest: .github/workflows/ + # - source: scripts/ + # dest: scripts/ + # - source: docker/ + # dest: docker/ diff --git a/.github/workflows/downstream-mechanics-updates.yml b/.github/workflows/send-updates.yml similarity index 100% rename from .github/workflows/downstream-mechanics-updates.yml rename to .github/workflows/send-updates.yml diff --git a/.github/workflows/starting-course.yml b/.github/workflows/starting-course.yml index d2cce463..0de1580d 100644 --- a/.github/workflows/starting-course.yml +++ b/.github/workflows/starting-course.yml @@ -77,8 +77,10 @@ jobs: run: | # Cleanup rm -rf \ - .github/workflows/downstream-mechanics-updates.yml \ + .github/workflows/send-updates.yml \ + .github/workflows/test-send-updates.yml \ .github/sync.yml \ + .github/test-sync.yml \ .github/workflows/starting-course.yml \ .github/ISSUE_TEMPLATE/course-template-problem-report.md \ .github/ISSUE_TEMPLATE/course-template-feature-request.md \ @@ -92,7 +94,7 @@ jobs: resources/images/04-figures_files \ Course_Name.rds \ docs/*.html \ - docs/*.md + docs/*.md # Commit modified files - name: Commit deleted files diff --git a/.github/workflows/test-send-updates.yml b/.github/workflows/test-send-updates.yml new file mode 100644 index 00000000..fdac25fb --- /dev/null +++ b/.github/workflows/test-send-updates.yml @@ -0,0 +1,40 @@ +# Candace Savonen Aug 2021 + +name: Test Sync Files + +on: + release: + types: [prereleased, published] + workflow_dispatch: + inputs: + prtag: + description: 'Tag to use?' + required: true + default: 'null' + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@master + + - name: Get the version + id: get_tag + run: | + if [ github.event.inputs.prtag == 'null' ] + then + echo ::set-output name=version::$(echo $GITHUB_REF | cut -d / -f 3) + fi + if [ github.event.inputs.prtag != 'null' ] + then + echo ::set-output name=version::${{ github.event.inputs.prtag }} + fi + + + - name: Run Mechanics File Sync + uses: BetaHuhn/repo-file-sync-action@v1.7.1 + with: + GH_PAT: ${{ secrets.GH_PAT }} + COMMIT_BODY: release-${{ steps.get_tag.outputs.version }} + CONFIG_PATH: ./github/workflows/test-sync.yml