-
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.
chore: screw the project and go right to issue
- Loading branch information
1 parent
2839c7c
commit 3e2d88a
Showing
2 changed files
with
41 additions
and
50 deletions.
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,41 @@ | ||
name: Create issue from discussion | ||
|
||
on: | ||
discussion: | ||
types: [labeled] | ||
|
||
jobs: | ||
create-issue: | ||
if: contains(fromJson('["explorer", "indexer"]'), github.event.label.name) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Generate token | ||
id: generate_token | ||
uses: tibdex/github-app-token@v2 | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: Create issue | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ steps.generate_token.outputs.token }} | ||
script: | | ||
const label = context.payload.label.name; | ||
const discussion = context.payload.discussion; | ||
const repoMap = { | ||
'explorer': 'stampchain-io/BTCStampsExplorer', | ||
'indexer': 'stampchain-io/btc_stamps', | ||
}; | ||
if (repoMap[label]) { | ||
const [owner, repo] = repoMap[label].split('/'); | ||
await github.rest.issues.create({ | ||
owner: owner, | ||
repo: repo, | ||
title: `Discussion: ${discussion.title}`, | ||
body: `Created from discussion: ${discussion.html_url}\n\n${discussion.body}`, | ||
labels: ['from-discussion'] | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.