Skip to content

Commit

Permalink
update starting course yml
Browse files Browse the repository at this point in the history
  • Loading branch information
cansavvy committed Mar 12, 2024
1 parent de1032b commit 6685799
Showing 1 changed file with 8 additions and 39 deletions.
47 changes: 8 additions & 39 deletions .github/workflows/starting-course.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
name: Starting a new course

on:
push:
branches: [ main, staging ]
workflow_dispatch:
create:

jobs:
# Run cleaning process only if workflow is triggered by not being in the Bookdown template anymore
template-cleanup:
name: Template Cleanup
first-time-setup:
# ensure run only once, when repo generated
if: github.run_number == 1

runs-on: ubuntu-latest
if: github.event.repository.name != 'OTTR_Template'
steps:
- name: checkout repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -54,39 +52,10 @@ jobs:
docs/*.md \
manuscript/*
# Commit modified files
- name: Commit deleted files
id: commit_it
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Template cleanup"
pushed_it=true
git push || pushed_it=false
echo "pushed_it=$pushed_it" >> $GITHUB_OUTPUT
# If main is already protected, then file a PR
- name: Create PR with deleted files
if: steps.commit_it.outputs.pushed_it == 'false'
uses: peter-evans/create-pull-request@v3
id: pr
- name: Commit changed files
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit-message: Delete unnecessary files
signoff: false
branch: auto_copy_rendered_files
delete-branch: true
title: 'Automatic course set up'
body: |
### Description:
This PR was initiated by the github actions. It helps set up this repository to be ready to write your course.
It deletes some remnant files you don't need for your course but were used when this was a template.
labels: |
automated
reviewers: $GITHUB_ACTOR
token: ${{secrets.GH_PAT}}
commit_message: "Setup repo"

##### Filing issues!

Expand Down

0 comments on commit 6685799

Please sign in to comment.