From 6dbc73d48ae7dd7125e85e8b8b126e3dffa6f8f8 Mon Sep 17 00:00:00 2001 From: Pasi Romo Date: Thu, 16 May 2024 16:22:05 +0200 Subject: [PATCH] chore: Update documentation --- .github/workflows/techdocs.yaml | 23 ------------------ README.md | 41 ++++++++++++++++++++++++++++++++- catalog-info.yaml | 1 - mkdocs.yaml | 7 ------ 4 files changed, 40 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/techdocs.yaml delete mode 100644 mkdocs.yaml diff --git a/.github/workflows/techdocs.yaml b/.github/workflows/techdocs.yaml deleted file mode 100644 index 4ad079b..0000000 --- a/.github/workflows/techdocs.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: Publish TechDocs Site - -on: - push: - branches: [main] - paths: - - "docs/**" - - "mkdocs.yaml" - workflow_dispatch: {} - -jobs: - publish-techdocs-site: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Build and publish docs - uses: idealo/publish-techdocs-action@v3 diff --git a/README.md b/README.md index b1d65c3..816b40f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,42 @@ # GitHub App installation access token generator -[See the documentation in Backstage](https://backstage.idealo.tools/catalog/default/component/github-app-token-generator/docs) +GitHub Action that can be used to generate an installation access token for a GitHub App. This token can for instance be used to clone repos, given the GitHub App has sufficient permissions to do so. + +## Usage + +```yaml +name: Checkout repos +on: push +jobs: + checkout: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: idealo/github-app-token-generator@v1.0.0 + id: get-token + with: + private-key: ${{ secrets.IDEALO_BOT_GH_APP_PRIVATE_KEY }} + app-id: ${{ secrets.IDEALO_BOT_GH_APP_ID }} + + - name: Check out an other repo + uses: actions/checkout@v2 + with: + repository: owner/repo + token: ${{ steps.get-token.outputs.token }} +``` + +## Requirements + +The action needs two input parameters, `private-key` and `app-id`. To get these, simply create a GitHub App. The private key can be generated and downloaded, and should be added to the repos as a secret. + +The installation ID that is used during the creation of the access token is created against the repo running the action. If you need to create the installation ID for a different repo you can use the `repo` input: + +```yaml +uses: idealo/github-app-token-generator@v1.0.0 +id: get-token +with: + private-key: ${{ secrets.IDEALO_BOT_GH_APP_PRIVATE_KEY }} + app-id: ${{ secrets.IDEALO_BOT_GH_APP_ID }} + repo: some/repo +``` diff --git a/catalog-info.yaml b/catalog-info.yaml index a85a23d..ff62ef7 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -9,7 +9,6 @@ metadata: annotations: github.com/project-slug: idealo/github-app-token-generator github.com/team-slug: idealo/compute - backstage.io/techdocs-ref: dir:. tags: - github-action - github-app diff --git a/mkdocs.yaml b/mkdocs.yaml deleted file mode 100644 index af4b919..0000000 --- a/mkdocs.yaml +++ /dev/null @@ -1,7 +0,0 @@ -site_name: 'your documentation site name' -site_description: 'a brief description' -#uncomment the below lines if you want to enable the edit button in your techdocs -#edit_uri: blob/main/docs/ #don't change it, just uncomment -#repo_url: '' -plugins: - - techdocs-core