Skip to content

Instantly share code, notes, and snippets.

@joshjohanning
Created March 30, 2023 13:57
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/368fc2e9a2ce21c01fa3b929bec875b8 to your computer and use it in GitHub Desktop.
Save joshjohanning/368fc2e9a2ce21c01fa3b929bec875b8 to your computer and use it in GitHub Desktop.
sample workflow for github app
name: demo
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: getting this repo
uses: actions/checkout@v3
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ vars.DEMO_APP_LIBRARY_APP_ID }}
installation_id: ${{ vars.DEMO_APP_LIBRARY_INSTALLATION_ID }}
private_key: ${{ secrets.DEMO_APP_LIBRARY_PRIVATE_KEY }}
- name: get the other repo
run: git clone https://user:${{ steps.generate_token.outputs.token }}@github.com/joshjohanning-org/demo-shared-library-from-app.git
- name: ls everything
run: ls -R
- name: how are we doing with the api
run: |
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.generate_token.outputs.token }}"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/rate_limit
- name: create new issue
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
gh issue create --title "I found a bug" --body "Nothing works" -R joshjohanning-org/demo-shared-library-from-app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment