Skip to content

Updates

Updates #106

Workflow file for this run

name: Sync Skills
on:
push:
branches:
- 'v*'
paths:
- 'SKILLS/**'
workflow_dispatch:
jobs:
sync-skills:
runs-on: ubuntu-latest
steps:
- name: Checkout source repository
uses: actions/checkout@v7
with:
path: source
- name: Checkout skills repository
uses: actions/checkout@v7
with:
repository: shinyorg/skills
token: ${{ secrets.SKILLS_REPO_TOKEN }}
path: skills-repo
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Sync skills into the shiny plugin
env:
SOURCE_DIR: SKILLS
run: |
set -euo pipefail
# All Shiny skills live in a single "shiny" plugin in shinyorg/skills.
# Every skill directory under $SOURCE_DIR is copied whole, so SKILL.md
# plus any reference/ content syncs together.
target_dir="skills-repo/plugins/shiny/skills"
if [ ! -d "$target_dir" ]; then
echo "::error::$target_dir does not exist in shinyorg/skills — has the plugin been renamed?"
exit 1
fi
synced=0
for skill_dir in "source/$SOURCE_DIR"/*/; do
[ -d "$skill_dir" ] || continue
skill_name=$(basename "$skill_dir")
echo "Syncing $skill_name -> plugins/shiny/skills/$skill_name"
rm -rf "${target_dir:?}/$skill_name"
cp -r "$skill_dir" "$target_dir/$skill_name"
synced=$((synced + 1))
done
if [ "$synced" -eq 0 ]; then
echo "::error::No skills found under $SOURCE_DIR/ — nothing to sync."
exit 1
fi
echo "Synced $synced skill(s)."
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.SKILLS_REPO_TOKEN }}
path: skills-repo
commit-message: "Update skills from shinyorg/controls"
title: "Update skills from Shiny Controls (${{ github.ref_name }})"
body: |
This PR updates the `shiny` plugin skills from the [Shiny Controls repository](https://github.com/shinyorg/controls).
**Source branch:** `${{ github.ref_name }}`
**Source commit:** ${{ github.sha }}
**Triggered by:** @${{ github.actor }}
---
*This PR was automatically created by the [sync-skills workflow](https://github.com/shinyorg/controls/actions/workflows/sync-skills.yml).*
branch: update-skills-controls-${{ github.ref_name }}
delete-branch: true
labels: |
automated
skills-update