Skip to content

Commit

Permalink
workflow to copy files to bioconductor branch
Browse files Browse the repository at this point in the history
  • Loading branch information
kjkrishnan committed Jan 11, 2024
1 parent 04ec188 commit 4f11ed3
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/copy_to_branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Get files from directories
FILES=$(find ${SRC_FOLDER_PATHS[@]} -type f)

# Add indicated individual files
for F in ${SRC_FILE_PATHS[@]}
do
FILES+=" ${F}"
done

# Pass these to github:
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
# Fetch branches
git fetch
# Checkout target branch
git checkout $TARGET_BRANCH
# Copy files in $FILES list from master branch
git checkout master -- $FILES
# Commit to the repository (ignore if no changes)
git add -A
git diff-index --quiet HEAD || git commit -am "update files"
# Push to remote branch
git push origin $TARGET_BRANCH
23 changes: 23 additions & 0 deletions .github/workflows/bioc_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Update Bioconductor package files

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

jobs:
copy:
name: Copy files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: copy
env:
SRC_FOLDER_PATHS: (data-raw man R tests vignettes)
SRC_FILE_PATHS: (DESCRIPTION LICENSE NAMESPACE NEWS.md README.md)
TARGET_BRANCH: 'bioconductor'
run: .github/copy_to_branch.sh

0 comments on commit 4f11ed3

Please sign in to comment.