Skip to content

Fetch Remote Assets #13

Fetch Remote Assets

Fetch Remote Assets #13

name: Fetch Remote Assets
on: workflow_dispatch
# permissions:
# contents: write
env:
MODULES_LIST_URL: "https://raw.githubusercontent.com/nesi/modules-list/main/module-list.json"
GLOSSARY_URL: "https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/Glossary.md"
DICTIONARY_URL: "https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/dictionary.txt"
SNIPPETS_URL: "https://raw.githubusercontent.com/nesi/nesi-wordlist/main/outputs/snippets.md"
BRANCH_NAME: "new-assets"
jobs:
fetch-includes:
runs-on: ubuntu-latest
steps:
- name: "Set Up Env"
uses: actions/checkout@v3
- run: git config --global user.name "${GITHUB_ACTOR}"
- run: git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- run: git checkout -b ${BRANCH_NAME}
- name: Fetch Module List
run: wget -O docs/assets/module-list.json ${MODULES_LIST_URL}
- name: Fetch Glossary
run: wget -O docs/assets/glossary/Glossary.md ${GLOSSARY_URL}
- name: Fetch Dictionary
run: wget -O docs/assets/glossary/dictionary.txt ${DICTIONARY_URL}
- name: Fetch Snippets
run: wget -O docs/assets/glossary/snippets.md ${SNIPPETS_URL}
- name: Commit to Branch '${BRANCH_NAME}'
run: git add --all
- run: git commit -m "update remote assets"
- name: Sync with upstream (if applicable).
run: git pull origin ${BRANCH_NAME} || true
- name: Open Pull Request
run: gh pr create -B main -H ${BRANCH_NAME} --title 'Update remote assets' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}