ImagingDataCommons / idc-index-data

Python package providing the index to query and download data hosted by the NCI Imaging Data Commons
MIT License
1 stars 4 forks source link

Create GitHub App called "ImagingDataCommons App" #6

Open jcfr opened 4 months ago

jcfr commented 4 months ago

To support creating authoring commits and pull-requests from GitHub workflow like bump-idc-index-data-version.yml discussed in https://github.com/ImagingDataCommons/idc-index-data/pull/5, consider the following:

  1. Go to https://github.com/organizations/ImagingDataCommons/settings/apps
  2. Click New GitHub App
  3. Enter the following details:

    GitHub App Name ImagingDataCommons App
    Description This ImagingDataCommons GitHub App supports the automation of commits and pull requests creation in GitHub workflow.
    Homepage URL https://portal.imaging.datacommons.cancer.gov/
    Webhook Disable
    Where can this GitHub App be installed? Only on this account (default)
    Repository permmissions Contents set to "Read And Write", Metadata set to "Read-only", Pull requests set to "Read And Write"
    Organization permissions Members set to "Read only"
    Account permissions None

This will allow to leverage the actions/create-github-app-token^1 along with peter-evans/create-pull-request. For a similar example, see the workflow^3 we created in NA-MIC/ProjectWeek (it using tibdex/github-app-token now superseded by actions/create-github-app-token but that should be enough to move forward)

jcfr commented 4 months ago

Once the app is created:

  1. generate client secret (keep track of the value in your password manager/secure notes)
  2. create a private key (a file will be downloaded, also keep track of it in your password manager/secure notes)
  3. install the app following these instruction. See https://docs.github.com/en/apps/using-github-apps/installing-your-own-github-app#installing-your-own-github-app
  4. Add organization level^1 secrets and variables
    • IDC_APP_ID as a regular variable
    • IDC_APP_PRIVATE_KEY as a secret variable available only to idc-index-data