Skip to content

Publish to fig autocomplete #83

Publish to fig autocomplete

Publish to fig autocomplete #83

name: Publish to fig autocomplete
on:
workflow_call:
workflow_dispatch:
jobs:
get-cli-version:
runs-on: pub-hk-ubuntu-22.04-small
outputs:
version: ${{ steps.cli-version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: Get Heroku Version
id: cli-version
run: version=$(./bin/run version | sed -n 's/.*v\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p')
push-to-fig-autocomplete:
runs-on: pub-hk-ubuntu-22.04-small
env:
CLI_VERSION: ${{ needs.get-cli-version.outputs.version }}
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: Create Fig Autocomplete PR
run: echo "$CLI_VERSION"
# 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: ${{ env.CLI_VERSION }}
# pr-body: Automated PR for latest Heroku CLI release