-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
468e5ef
commit 8ee7ead
Showing
13 changed files
with
1,070 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = false | ||
insert_final_newline = false |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Pull Request | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
preview-changes: | ||
name: Preview changes | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v2 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- run: yarn install | ||
- name: Install pulumi | ||
uses: pulumi/[email protected] | ||
- uses: pulumi/actions@v2 | ||
env: | ||
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
PULUMI_GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
with: | ||
command: preview | ||
refresh: true | ||
stack-name: prod | ||
comment-on-pr: true | ||
github-token: ${{ secrets.BJERKBOT_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Push | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
apply-changes: | ||
name: Apply changes | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v2 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- run: yarn install | ||
- name: Install pulumi | ||
uses: pulumi/[email protected] | ||
- uses: pulumi/actions@v2 | ||
env: | ||
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.BJERKBOT_GITHUB_TOKEN }} | ||
PULUMI_GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
with: | ||
command: up | ||
refresh: true | ||
stack-name: prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"proseWrap": "always", | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"arrowParens": "avoid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: bjerk-bot | ||
runtime: nodejs | ||
description: The Bjerk Bot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,28 @@ | ||
# bot | ||
<div style="text-align: center"> | ||
<img src=".github/header.svg" width="200px"> | ||
</div> | ||
|
||
# Bjerk Bot | ||
|
||
This repository contains code that defines which repositories the [@bjerkbot][bjerkbot] has access to. | ||
|
||
## Add `bjerk-bot` to your repository! | ||
|
||
You'll probably want to install [Github CLI][github-cli]. That will help you to get the `inviteId` (e.g. `44182036`). | ||
|
||
1. Run `gh api -XPUT repos/:owner/:repo/collaborators/bjerk-bot` | ||
2. Copy the `"id"`. | ||
3. Open a pull request where you add this inviteId. Remember to add the repository as a comment. | ||
|
||
```typescript | ||
export const repositories = [ | ||
44182036, // bjerkio/bot | ||
]; | ||
``` | ||
|
||
<img width="600" src="https://raw.githubusercontent.com/bjerkio/bot/main/.github/demo.svg" /> | ||
|
||
Open a pull request with your invi | ||
|
||
|
||
[bjerkbot]: https://github.com/bjerk-bot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// import * as pulumi from '@pulumi/pulumi'; | ||
import * as github from '@pulumi/github'; | ||
import { repositories } from './repositories'; | ||
|
||
repositories.map( | ||
({ repo, invitationId }) => | ||
new github.UserInvitationAccepter(repo, { | ||
invitationId: String(invitationId), | ||
}), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "github-npm-token", | ||
"devDependencies": { | ||
"@types/node": "^10.0.0" | ||
}, | ||
"dependencies": { | ||
"@pulumi/github": "^3.4.0", | ||
"@pulumi/pulumi": "^2.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const repositories = [ | ||
{ repo: 'bjerkio/bot', invitationId: 44182036 }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"outDir": "bin", | ||
"target": "es2016", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"experimentalDecorators": true, | ||
"pretty": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"files": [ | ||
"index.ts" | ||
] | ||
} |
Oops, something went wrong.