From 1e02bd5721fb95e41f40d7530d9965a2fff17bf8 Mon Sep 17 00:00:00 2001 From: Mohammad Ismail <96207520+mouismail@users.noreply.github.com> Date: Wed, 21 Feb 2024 21:36:37 +0100 Subject: [PATCH] docs(README): add GHES workflow example (#104) This pull request includes a significant change to the `README.md` file. The change adds a new job to the GitHub Actions workflow, which is designed to create an example of how to use `create-github-app-token` action on GitHub Enterprise Server. Resolves https://github.com/actions/create-github-app-token/issues/98 --------- Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index f7ec8d1..3d43472 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,29 @@ jobs: ```yaml on: [push] + +jobs: + create_issue: + runs-on: self-hosted + + steps: + - name: Create GitHub App token + id: create_token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.GHES_APP_ID }} + private-key: ${{ secrets.GHES_APP_PRIVATE_KEY }} + owner: ${{ vars.GHES_INSTALLATION_ORG }} + github-api-url: ${{ vars.GITHUB_API_URL }} + + - name: Create issue + uses: octokit/request-action@v2.x + with: + route: POST /repos/${{ github.repository }}/issues + title: "New issue from workflow" + body: "This is a new issue created from a GitHub Action workflow." + env: + GITHUB_TOKEN: ${{ steps.create_token.outputs.token }} ``` ## Inputs