Skip to content

Update docs

Update docs #11

Workflow file for this run

name: Update docs
on:
workflow_dispatch:
jobs:
fetch_readmes:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Git configuration
uses: michijs/.github/.github/actions/set-git-config-github-actions@main
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Fetch npm Versions
id: fetch_versions
run: |
VERSIONS=$(npm show @michijs/michijs versions --json)
FILTERED_VERSIONS=$(echo "$VERSIONS" | jq -r 'map(select(. | test("beta|rc") | not)) | join(" ")')
echo "VERSIONS=$FILTERED_VERSIONS" >> $GITHUB_ENV
- name: Retrieve READMEs
id: fetch_readmes
run: |
VERSIONS="${{ env.VERSIONS }}"
for version in $(echo "${VERSIONS}" | jq -r '.[]'); do
if [[ $version == $(echo "$VERSIONS" | awk '{print $NF}') ]]; then
wget -O README.md https://raw.githubusercontent.com/michijs/michijs/v$version/README.md
else
wget -O v$version.md https://raw.githubusercontent.com/michijs/michijs/v$version/README.md
fi
done
- name: Commit changes
uses: michijs/.github/.github/actions/commit-if-changes@main
with:
message: "Readme update"
- name: Push changes
uses: michijs/.github/.github/actions/pull-and-push@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}