Skip to content

Instantly share code, notes, and snippets.

@joshjohanning
Created January 12, 2022 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshjohanning/c8396322b2461713dcb238f27911d9e6 to your computer and use it in GitHub Desktop.
Save joshjohanning/c8396322b2461713dcb238f27911d9e6 to your computer and use it in GitHub Desktop.
use an app id, installation id, and private key to clone a repo with github apps
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: jnwng/github-app-installation-token-action@v2
id: get_installation_token
with:
appId: 164334
installationId: 22210353
privateKey: ${{ secrets.PRIVATE_KEY_FOR_ANSIBLE }}
- name: one way to checkout
run: |
mkdir test
cd test
echo ${{ steps.get_workflow_token.outputs.token }}
git clone https://user:${{ steps.get_installation_token.outputs.token }}@github.com/joshjohanning-org/composite-caller-1.git
- name: Checkout
uses: actions/checkout@v2.4.0
with:
repository: joshjohanning-org/composite-caller-1
token: ${{ steps.get_installation_token.outputs.token }}
path: test-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment