Skip to content

fix(openapi/upload): restore --working-directory #2274

fix(openapi/upload): restore --working-directory

fix(openapi/upload): restore --working-directory #2274

Workflow file for this run

name: Sync docs to ReadMe
# Run workflow for every push to the `main`/`next branches
# (or on pushes to pull requests against these branches)
on:
push:
branches:
- main
- next
pull_request:
branches:
- main
- next
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v5
- name: Install and build rdme deps
run: npm ci && npm run build
# Since this workflow file is in the `rdme` repository itself,
# we need to test the GitHub Action using the current commit.
# This step builds the `rdme` action code so we can do that.
#
# This step is not required for syncing your docs to ReadMe!
- name: Rebuild GitHub Action for testing purposes
# We manually invoke `bin/write-gha-pjson.js` here because
# GitHub Actions does not support `pre` scripts for local actions.
run: npm run build:gha && bin/write-gha-pjson.js
# Let's dynamically update our docs with the latest version of rdme!
# Note that these next three steps are not required
# in order to sync your docs to ReadMe.
# First, we run a script that sets a few outputs:
# our package version and our Node.js version.
- name: Retrieve version values
id: rdme-version
run: ./bin/set-version-output.js
# Next, we use this output to do a few find/replaces!
- name: Find and replace Node.js version placeholders
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'NODE_VERSION'
replace: ${{ steps.rdme-version.outputs.NODE_VERSION }}
regex: false
include: documentation/synced/*
- name: Find and replace `rdme` version placeholders
uses: jacobtomlinson/gha-find-replace@v3
with:
find: 'RDME_VERSION'
replace: ${{ steps.rdme-version.outputs.RDME_VERSION }}
regex: false
include: documentation/synced/*
# And finally, with our updated documentation,
# we run the `rdme` GitHub Action to sync the Markdown file
# in the `documentation` directory.
# Here's the page we're syncing: https://docs.readme.com/docs/rdme
# First we're going to perform a dry run of syncing process.
# We do this on every push to ensure that an actual sync will work properly
- name: Sync docs to ReadMe (dry run)
uses: ./
with:
rdme: docs upload ./documentation/synced --key=${{ secrets.README_DEVELOPERS_API_KEY }} --branch=${{ vars.README_DEVELOPERS_MAIN_VERSION }} --dry-run
- name: Sync docs to ReadMe
# And finally, we perform an actual sync to ReadMe if we're on the main branch
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
# We use the `main` branch as ref for GitHub Action
# This is NOT recommended, as it can break your workflows without notice!
# We recommend specifying a major version tag, e.g., `readmeio/rdme@v10`
# Docs: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#example-using-versioned-actions
uses: readmeio/rdme@main
with:
rdme: docs upload ./documentation/synced --key=${{ secrets.README_DEVELOPERS_API_KEY }} --branch=${{ vars.README_DEVELOPERS_MAIN_VERSION }}