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

feat: initial setup #1

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/steward.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
name: DIY Steward
name: Scala Center Steward

on:
schedule:
- cron: '0 */4 * * *'
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
steward:
runs-on: ubuntu-latest
name: DIY Steward
name: Scala Center Steward
steps:
- uses: actions/checkout@v3

- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: 123456
private_key: ${{ secrets.APP_PRIVATE_KEY }}
app_id: ${{ secrets.SCALA_STEWARD_APP_ID }}
private_key: ${{ secrets.SCALA_STEWARD_APP_PRIVATE_KEY }}

- name: Launch Scala Steward
uses: scala-steward-org/scala-steward-action@v2
with:
github-token: ${{ steps.generate-token.outputs.token }}
author-email: 123456+your-app-name[bot]@users.noreply.github.com
author-name: your-app-name[bot]
github-app-id: 123456
github-app-key: ${{ secrets.APP_PRIVATE_KEY }}
repos-file: 'repos.md'
author-email: 123456+scala-center-steward[bot]@users.noreply.github.com
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to wait for a pr to be sent in to get this ID as it's not the same as SCALA_STEWARD_APP_ID.

armanbilge/diy-steward#1

author-name: scala-center-steward[bot]
46 changes: 10 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,15 @@
# diy-steward
Set up your very own Scala Steward!
# Scala Center Steward

1. Use this template to create a new repo.
2. Create a new GitHub App.
- Personal app: https://github.com/settings/apps/new
- Org app: `https://github.com/organizations/[your-org]/settings/apps/new`
3. You can disable the Webhook and set the App homepage to your new repo.
4. Grant the App the following permissions:
- Actions: Read-only
- Contents: Read and write
- Metadata: Read-only
- Pull requests: Read and write
- Workflows: Read and write (this is required to support the sbt-github-actions plugin)
5. Create the app. Note the app ID, we will need it later.
6. Generate and download an App private key.
7. Install the app on your repos. It _must_ be installed in this repo and it should also be installed on any repo you want steward updates on.
- Personal: `https://github.com/settings/apps/[your-app-name]/installations`
- Org: `https://github.com/organizations/[your-org]/settings/apps/[your-app-name]/installations`
8. In this repo, set the secret `APP_PRIVATE_KEY` to the contents of the private key you downloaded.
9. Finally, edit [`.github/workflows/steward.yml`](.github/workflows/steward.yml):
- Replace the 3 instances of `123456` with your app ID (see also [#1](https://github.com/armanbilge/diy-steward/issues/1))
- Replace the 2 instances of `your-app-name` with your app's name.
- Tweak the scheduling as you see fit. Default is ["At minute 0 past every 4th hour."](https://crontab.guru/#0_*/4_*_*_*)
10. That's it! To manually trigger your new steward, navigate to the Actions tab on this repo, select the Scala Steward workflow, and click "Run Workflow".
Runs the
[scala-steward-action](https://github.com/scala-steward-org/scala-steward-action)
daily to ensure dependencies across the Scala Center stay up to date.
ckipp01 marked this conversation as resolved.
Show resolved Hide resolved

Please open issues or PRs with any improvements and fixes for this template. Thank you!
PRs are sent in by ???

## Running with repos.md
## Adding a repo

If you [use a repos.md file to list repositories](https://github.com/scala-steward-org/scala-steward-action#using-a-file-to-list-repositories), be sure to remove the `github-app-id` and `github-app-key` from the `scala-steward-action` configuration. For example:
Edit the [repos.md](./repos.md) file.

```yaml
- name: Launch Scala Steward
uses: scala-steward-org/scala-steward-action@v2
with:
github-token: ${{ steps.generate-token.outputs.token }}
author-email: 123456+your-app-name[bot]@users.noreply.github.com
author-name: your-app-name[bot]
repos-file: 'repos.md'
```
**NOTE:** THis steward instance is only for `scalacenter` org repos. If you're
outside of the org and would like to run Steward on your repos check out
[diy-steward](https://github.com/armanbilge/diy-steward).
15 changes: 15 additions & 0 deletions repos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- scalacenter/bloop
- scalacenter/bloop-config
- scalacenter/effective-scala-slide-code
- scalacenter/library-example
- scalacenter/sbt-scalafix
- scalacenter/sbt-scalafix-example
- scalacenter/sbt-version-policy
- scalacenter/scala3-migrate
- scalacenter/scaladex
- scalacenter/scalafix
- scalacenter/scalafix.g8
- scalacenter/scalajs-bundler
- scalacenter/scala-3-migration-guide
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t know if we still maintain this repo since the content has been included in docs.scala-lang. @adpi2, should we have the Steward here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge now just to see if this all works. If you want to remove the migration guide, we can do it after, or even just edit the repos.md @adpi2 .

- scalacenter/scala-debug-adapter
- scalacenter/scastie