Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook runner CI doesn't work on forks #130

Open
grst opened this issue Nov 30, 2023 · 1 comment
Open

Notebook runner CI doesn't work on forks #130

grst opened this issue Nov 30, 2023 · 1 comment

Comments

@grst
Copy link
Collaborator

grst commented Nov 30, 2023

When someone creates a PR from a fork, the CI does not have permission to add commits to the branch.

To my knowledge, the only real way to solve this is to develop a github application.

For now, it is easiest to add someone who makes a PR to this repo and ask them to push to a local branch.

CC @flying-sheep

@flying-sheep
Copy link
Member

flying-sheep commented Dec 1, 2023

I recently made a GitHub application: https://github.com/apps/spencer-hobson

It was relatively easy. Manually, we use it like this:

- name: Get bot token
  id: create_token
  uses: tibdex/github-app-token@v2
  with:
    app_id: ${{ secrets.SPENCER_APP_ID  }}
    private_key: ${{ secrets.SPENCER_PRIVATE_KEY }}

- name: Clone repo
  uses: actions/checkout@v4
  with:
    token: ${{ steps.create_token.outputs.token }}
    fetch-depth: 0
    filter: blob:none

- name: Commit autofixes
  uses: stefanzweifel/git-auto-commit-action@v5
  with:
    commit_message: "chore: auto-fix eslint errors"
    commit_user_name: spencer-hobson[bot]
    # This uses the anonymous identity record number you can get via:
    # https://api.github.com/users/spencer-hobson[bot]
    commit_user_email: 149329160+spencer-hobson[bot]@users.noreply.github.com

but of course that only works in repos that have access to the private key, so we need to figure out how to make the app do its thing with a central installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants