-
Notifications
You must be signed in to change notification settings - Fork 440
36 lines (31 loc) · 1.14 KB
/
add-resource.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
name: Add Resource
on:
workflow_dispatch:
inputs:
resource:
description: 'Resource Name'
required: true
default: 'wai-about-wai'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Adding resource submodule
run: |
[ -d _external/resources/$WAI_NEW_RESOURCE ] && echo "Resource $WAI_NEW_RESOURCE exists" && exit 1
git submodule update --init --remote
git submodule add https://github.com/w3c/$WAI_NEW_RESOURCE.git _external/resources/$WAI_NEW_RESOURCE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WAI_NEW_RESOURCE: ${{ github.event.inputs.resource }}
- name: Linking in resource
run: |
ln -s ../_external/resources/$WAI_NEW_RESOURCE/content pages/$WAI_NEW_RESOURCE
ln -s ../_external/resources/$WAI_NEW_RESOURCE/content-images/$WAI_NEW_RESOURCE content-images/$WAI_NEW_RESOURCE
env:
WAI_NEW_RESOURCE: ${{ github.event.inputs.resource }}
- name: Commit changed files
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply automatic changes