Publish to fig autocomplete #70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to fig autocomplete | |
on: | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
push-to-fig-autocomplete: | |
runs-on: pub-hk-ubuntu-22.04-small | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: yarn | |
- name: Install Fig Oclif Plugin | |
run: cd packages/cli && yarn add @fig/complete-oclif && jq '.oclif.plugins += ["@fig/complete-oclif"]' package.json > temp.json && mv temp.json package.json | |
- run: yarn --immutable --network-timeout 1000000 | |
- name: Build Heroku CLI | |
run: yarn build | |
- name: Generate Fig Spec | |
run: cd packages/cli && ./bin/run generate-fig-spec > spec.ts | |
- name: Get Heroku Version | |
id: cli-version | |
run: echo "version=$(./bin/run --version | sed -rn 's/^heroku\/([0-9\.]+).*$/\1/p')" | |
- name: Create Fig Autocomplete PR | |
uses: withfig/push-to-fig-autocomplete-action@v2 | |
with: | |
token: ${{ secrets.HEROKU_CLI_BOT_TOKEN }} | |
autocomplete-spec-name: 'heroku' | |
spec-path: ./packages/cli/spec.ts | |
integration: oclif | |
diff-based-versioning: true | |
new-spec-version: ${{ steps.cli-version.outputs.version }} | |
pr-body: Automated PR for latest Heroku CLI release |