Skip to content

Commit

Permalink
Replace obsolete 'Generate Token' step
Browse files Browse the repository at this point in the history
Working on #44 -
now that scala-steward-org/scala-steward-action#428
updated the Scala Steward GitHub Action to have its _own_ support for
GitHub App authentication, we can remove the additional 'Generate token'
step from our GitHub Action workflow, with these benefits:

* No longer need to use the tibdex/github-app-token - one fewer action
  we need to trust
* In a subsequent step, we may be able to remove the necessity of
  adding repos to `REPOSITORIES.md` - as, so far as I can see, the GitHub
  Action will now automatically run on all repos we install it on, without
  having to also add them to `REPOSITORIES.md`:
  https://github.com/scala-steward-org/scala-steward/blob/113884ac11d639ed8b70fc368f6a69895b14f8ba/modules/core/src/main/scala/org/scalasteward/core/application/StewardAlg.scala#L97-L98
  • Loading branch information
rtyley committed Jun 2, 2023
1 parent d387303 commit 83c6d14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/public-repos-scala-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ jobs:
uses: ./.github/workflows/reusable-scala-steward.yml
with:
app_id: 214238
app_installation_id: 26822732
secrets:
private_key: ${{ secrets.SCALA_STEWARD_APP_PRIVATE_KEY }}
17 changes: 7 additions & 10 deletions .github/workflows/reusable-scala-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
app_id:
required: true
type: string
app_installation_id:
required: true
type: string
secrets:
private_key:
required: true
Expand All @@ -22,19 +25,13 @@ jobs:
with:
repository: guardian/scala-steward-public-repos
path: common-config
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ inputs.app_id }}
private_key: ${{ secrets.private_key }}

- name: Execute Scala Steward
uses: scala-steward-org/[email protected]

with:
# Use the token generated by the previous step and the
# Guardian Scala Steward GitHub App
github-token: ${{ steps.generate-token.outputs.token }}
repos-file: REPOSITORIES.md
github-app-id: ${{ inputs.app_id }}
github-app-installation-id: ${{ inputs.app_installation_id }}
github-app-key: ${{ secrets.private_key }}
repos-file: REPOSITORIES.md # possibly no longer necessary, thanks to `github-app-*` configuration
repo-config: common-config/scala-steward.conf # from checkout of guardian/scala-steward-public-repos

0 comments on commit 83c6d14

Please sign in to comment.