diff --git a/.github/workflows/slack-cli-generate-docs.yaml b/.github/workflows/slack-cli-generate-docs.yaml new file mode 100644 index 00000000..61b8e7eb --- /dev/null +++ b/.github/workflows/slack-cli-generate-docs.yaml @@ -0,0 +1,43 @@ +name: Generate Slack CLI Docs + +on: + workflow_dispatch: + +jobs: + update-docs: + runs-on: ubuntu-latest + + steps: + + - name: Install Slack CLI + run: | + curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash + + - name: Generate a GitHub token + id: ghtoken + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.GH_APP_ID }} + owner: slackapi + private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Generate docs + run: | + slack docgen docs/reference + + - name: Create a pull request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ steps.ghtoken.outputs.token }} + title: "Automated Slack CLI reference docs for release" + body: "Automatically updating Slack CLI docs following release" + author: "slackapi[bot] <186980925+slackapi[bot]@users.noreply.github.com>" + committer: "slackapi[bot] <186980925+slackapi[bot]@users.noreply.github.com>" + commit-message: "Update slack cli reference docs" + base: "main" + branch: "update-slack-cli-reference" + delete-branch: true + labels: docs \ No newline at end of file