generated from esciencecenter-digital-skills/NEBULA-content-template
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.51 KB
/
generate_config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Generate Config json File (Execute it only upon repository initialisation)
on:
push:
branches:
- '**'
permissions: write-all
jobs:
create-config:
runs-on: ubuntu-latest
steps:
- name: Checkout content
uses: actions/checkout@v4
- name: Create config.json
run: |
echo '{
"publicProps": {
"title": "Add a title for your lesson/project",
"baseURL": "${{ github.event.repository.name }}",
"repoName": "${{ github.event.repository.name }}",
"repoOwner": "esciencecenter-digital-skills",
"organization": "Netherlands eScience Center",
"categoryOrder": ["Category1", "Category2"]
}
}' > config.json
- name: Commit and push config.json
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add config.json
git commit -m "Create config.json" || exit 0 # Exits gracefully if there's nothing to commit
git push
- name: Disable this workflow once it has been run once on instantiation
shell: bash
run: |
gh workflow disable -R $GITHUB_REPOSITORY "${{ github.workflow }}"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}