FE
fedeci/push-to-fig-autocomplete-action
Action to automatically open a new PR to the https://github.com/withfig/autocomplete repo
Usage
name: 'Publish version'
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
push-to-fig-autocomplete:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
- name: Generate the spec
run:
## Execute commands to generate the spec through some official or thrid party integration
- name: Lint the generated spec
run: |
echo '{"extends":"@fig/autocomplete"}' > .tmp-eslintrc
npm i @fig/eslint-config-autocomplete
npx eslint@8 --config .tmp-eslintrc --fix path/to/generated-spec.ts
# Create the autocomplete PR using this action
- name: Create Autocomplete PR
uses: withfig/publish-to-fig-autocomplete@v1
with:
token: ${{ secrets.YOUR_PAT_HERE }}
autocomplete-spec-name: generated-spec
spec-path: path/to/generated-spec.ts
integration: commander
## Other jobs not related to the spec updateSupported Inputs
token(required): a GitHub personal access token with repo scopeautocomplete-spec-name(required): the name of the spec in the autocomplete repo in the form[scope/]namewhere name is the spec filename in the autocomplete repo. Examples:- if the spec relative path in the autocomplete repo is
src/npm.ts, thenautocomplete-spec-nameisnpm - if the spec relative path in the autocomplete repo is
src/@withfig/autocomplete-tools.ts, thenautocomplete-spec-nameis@withfig/autocomplete-tools
- if the spec relative path in the autocomplete repo is
spec-path(required): the path of the generated spec in the current repointegration: the name of the official Fig integration used See
We also provide support for third party autocomplete repos via the following inputs:
repo-org: name of the organization/user that stores the third party autocomplete repository (default:withfig)repo-name: name of the third party autocomplete repository (default:autocomplete)
NOTE: third party autocomplete repos must be structured as the official autocomplete one. Run
npx @withfig/autocomplete-tools@latest initto generate one.