Skip to content

Fixes the application name #35

Fixes the application name

Fixes the application name #35

##############################################################################
# Instruqt Github Actions Workflow
#
# This workflow will generate the track-slugs.yml file
#
##############################################################################
name: instruqt-generate
env:
INSTRUQT_TOKEN: ${{ secrets.INSTRUQT_TOKEN }}
TRACK_DIR: instruqt
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
types:
- opened
jobs:
CreateTrackSlugs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Find track descriptors
id: find-track-descriptors
run: |
files=$(find instruqt -name 'track.yml' -print0 | xargs -0 echo)
echo "files=$files" >> $GITHUB_OUTPUT
- name: Get the track slugs and IDs
id: get-track-slugs
uses: mikefarah/yq@master
with:
cmd: |
yq eval-all 'select(.id != null and .slug != null and ( contains({ "tags": "deprecated"}) | not ) and ( contains({ "tags": "template" } ) | not) and ( contains( { "tags": "internal" } ) | not ) ) | . as $item ireduce ([]; . + [{"slug": $item.slug, "id": $item.id}]) | {"tracks": . }'
- name: Update track slugs metadata
id: update-slugs
run: |
echo '${{ steps.get-track-slugs.outputs.result }}' > instruqt/track-slugs.yml
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Generating track-slugs.yml file