-
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
Showing
14 changed files
with
973 additions
and
0 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,15 @@ | ||
on: | ||
pull_request: | ||
paths: | ||
- '**/*.ts' | ||
- .github/workflows/ci.yml | ||
jobs: | ||
check-generated-dist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: npm ci | ||
env: | ||
NODE_ENV: development | ||
- run: npm run dist | ||
- run: git diff --exit-code |
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,14 @@ | ||
name: vx Tagger | ||
on: | ||
release: | ||
types: [published, edited] | ||
jobs: | ||
tag: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: sersoft-gmbh/running-release-tags-action@v1 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
update-full-release: true | ||
if: github.event.release.prerelease == false |
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 @@ | ||
node_modules |
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 @@ | ||
FROM node:16-alpine | ||
COPY dist dist | ||
ENTRYPOINT [ "node", "/dist/index.js" ] |
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,51 @@ | ||
# “New ‘Now Now’” for Git Things Done | ||
|
||
This action can be controlled externally to facilitate easy creation of new “Now | ||
Now”s. | ||
|
||
## iOS/macOS Shortcuts | ||
|
||
We provide shortcuts that you can “duplicate” to facilitate this. | ||
|
||
1. [Duplicate] | ||
2. Add to Homescreen/Dock/Menubar | ||
3. Tap/Click to add new items to the “Now Now” list[^1] | ||
|
||
<img width="378" alt="image" src="https://user-images.githubusercontent.com/58962/140531618-5012f544-4f25-4815-9978-f3f0e6bf80dd.png"> | ||
|
||
[Duplicate]: https://www.icloud.com/shortcuts/781d011ddf4748f78ac55d577de3bf20 | ||
[^1]: **Please note**, the shortcut will request a [Personal Access Token](https://github.com/settings/tokens) with `repo` scope. | ||
|
||
## Desired Features | ||
|
||
* Should be *easier* to set up (the PAT is tedious) | ||
* Both the action and our shortcut should support choosing priority | ||
|
||
|
||
# Setting Up | ||
|
||
> ***NOTE*** if you forked our template you will already have this. | ||
You need `.github/workflows/new-now-now.yml` in your [GitTD repo] containing: | ||
|
||
```yaml | ||
name: New “Now Now” | ||
on: | ||
repository_dispatch: | ||
types: new-now-now | ||
jobs: | ||
parse: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 #FIXME needed so we can get the CURRENT issue | ||
- run: echo "CURRENT=$(git show origin/gh-pages:CURRENT)" >> $GITHUB_ENV | ||
- uses: git-things-done/new-now-now@master | ||
with: | ||
today: ${{ env.CURRENT }} | ||
body: ${{ github.event.client_payload.body }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
[GitTD repo]: https://github.com/git-things-done/gtd |
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,16 @@ | ||
name: “New ‘Now Now’” for Git Things Done | ||
description: Creates a new “Now Now”. | ||
inputs: | ||
body: | ||
description: The content for the new “Now Now”. | ||
required: true | ||
today: | ||
description: Today’s issue number. | ||
required: true | ||
token: | ||
description: Typically `{{ secrets.GITHUB_TOKEN }}` | ||
default: ${{ github.token }} | ||
runs: | ||
using: docker | ||
image: Dockerfile | ||
# ^^ because we want node 16 so we can use modern features |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
{ | ||
"type": "module" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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,52 @@ | ||
import { lexer } from 'marked' | ||
import * as github from '@actions/github' | ||
import { getInput } from '@actions/core' | ||
import { exit } from 'process' | ||
|
||
const slug = process.env.GITHUB_REPOSITORY! | ||
const [owner, repo] = slug.split('/') | ||
const issue_number = parseInt((getInput('today') || process.env.GTD_TODAY)!) | ||
const token = getInput('token')! | ||
const octokit = github.getOctokit(token) | ||
const body = getInput('body') | ||
|
||
const comments = await octokit.rest.issues.listComments({ | ||
owner, | ||
repo, | ||
issue_number | ||
}) | ||
|
||
let out = '' | ||
for (const comment of comments.data) { | ||
|
||
//FIXME won’t work if eg. there’s a `# Right Now` | ||
if (!comment.body?.trim().startsWith('# Now Now')) continue; | ||
|
||
for (const item of lexer(comment.body)) { | ||
if (item.type === 'heading' && item.text == 'Just Now') { | ||
out = `${out.trim()} | ||
- [ ] ${body.trim()} | ||
` | ||
} | ||
out += item.raw | ||
} | ||
|
||
await octokit.rest.issues.updateComment({ | ||
owner, | ||
repo, | ||
comment_id: comment.id, | ||
body: out | ||
}) | ||
|
||
// only once thanks | ||
exit(0) | ||
} | ||
|
||
// found nothing, add a new comment | ||
await octokit.rest.issues.createComment({ | ||
owner, | ||
repo, | ||
issue_number, | ||
body: `# Now Now\n${body}` | ||
}) |
Oops, something went wrong.