From b7ffad7113f095b7dc266d82c997f4597e5e3b02 Mon Sep 17 00:00:00 2001 From: Grant Gurvis Date: Fri, 19 Jan 2024 13:35:21 -0800 Subject: [PATCH] Add `publish-to-fig-autocomplete.yml` action --- .../workflows/publish-to-fig-autocomplete.yml | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/publish-to-fig-autocomplete.yml diff --git a/.github/workflows/publish-to-fig-autocomplete.yml b/.github/workflows/publish-to-fig-autocomplete.yml new file mode 100644 index 0000000000..5854fe5c88 --- /dev/null +++ b/.github/workflows/publish-to-fig-autocomplete.yml @@ -0,0 +1,37 @@ +name: Publish to fig autocomplete + +on: + workflow_call: + workflow_dispatch: + input: + notUsed: + type: string + description: Run this workflow from a "release-*" branch. This input does nothing. + required: false + +jobs: + push-to-fig-autocomplete: + runs-on: ubuntu-latest + steps: + - name: Use Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: yarn + - run: yarn --immutable --network-timeout 1000000 + - name: Install Fig Oclif Plugin + run: ./bin/run plugins:install @fig/oclif-complete@2 + - name: Generate Fig Spec + run: ./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')" >> $GITHUB_OUTPUT + - name: Create Fig Autocomplete PR + uses: withfig/push-to-fig-autocomplete-action@v1 + with: + token: ${{ secrets.BOT_TOKEN }} + autocomplete-spec-name: 'heroku' + spec-path: spec.ts + integration: oclif + diff-based-versioning: true + new-spec-version: ${{ steps.cli-version.outputs.version }}