Skip to content

Commit

Permalink
Add a testing version of sync GHA (#344)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
cansavvy authored Dec 7, 2021
1 parent 10f118b commit e638575
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .github/test-sync.yml
Original file line number Diff line number Diff line change
@@ -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/
File renamed without changes.
6 changes: 4 additions & 2 deletions .github/workflows/starting-course.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/test-send-updates.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e638575

Please sign in to comment.