Skip to content

Added Korrektur Guide #36

Added Korrektur Guide

Added Korrektur Guide #36

name: Clone Repos, Run Script, and Commit Changes
on:
push:
branches-ignore:
- main
workflow_call:
workflow_dispatch:
jobs:
process-repos:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Generate App token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.REQ_UPDATER_APP_ID }}
private-key: ${{ secrets.REQ_UPDATER_APP_KEY }}
# Checkout the main repository
- name: Checkout Main Repo
uses: actions/checkout@v2
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
with:
path: Documentation
ref: ${{ github.ref }}
persist-credentials: false
# Checkout additional repositories at the same level as the main repo
- name: Checkout 2D_3D_AdLer Repo
uses: actions/checkout@v2
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
with:
repository: ProjektAdLer/2D_3D_AdLer
path: 2D_3D_AdLer
- name: Checkout Autorentool Repo
uses: actions/checkout@v2
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
with:
repository: ProjektAdLer/Autorentool
path: Autorentool
- name: Checkout AdLerBackend Repo
uses: actions/checkout@v2
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
with:
repository: ProjektAdLer/AdLerBackend
path: AdLerBackend
# Checkout Moodle plugins into the "plugins" subdir
- name: Checkout MoodlePluginLocal Repo
uses: actions/checkout@v2
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
with:
repository: ProjektAdLer/MoodlePluginLocal
path: plugins/MoodlePluginLocal
- name: Checkout MoodlePluginLocalLogging Repo
uses: actions/checkout@v2
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
with:
repository: ProjektAdLer/MoodlePluginLocalLogging
path: plugins/MoodlePluginLocalLogging
- name: Checkout MoodlePluginModAdleradaptivity Repo
uses: actions/checkout@v2
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
with:
repository: ProjektAdLer/MoodlePluginModAdleradaptivity
path: plugins/MoodlePluginModAdleradaptivity
- name: Checkout MoodlePluginAvailability Repo
uses: actions/checkout@v2
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
with:
repository: ProjektAdLer/MoodlePluginAvailability
path: plugins/MoodlePluginAvailability
# Install Node.js and run the script
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Run Script
run: |
cd Documentation/Scripts/Requirements
npm install --no-package-lock
node ./build/createRequirementReference.js
# Commit changes, if there are any
- name: Commit and Push Changes
run: |
cd ${{ github.workspace }}/Documentation
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Updated requirements" || echo "No changes to commit"
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ steps.generate-token.outputs.token }}
repository: ${{ env.GITHUB_REPOSITORY }}
directory: Documentation
branch: ${{ github.ref }}