Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into node-mutations-are-…
Browse files Browse the repository at this point in the history
…a-no-no
  • Loading branch information
pieh committed Dec 7, 2021
2 parents de72e9c + 6113cfc commit fd54ceb
Show file tree
Hide file tree
Showing 321 changed files with 15,662 additions and 15,334 deletions.
1 change: 1 addition & 0 deletions .github/actions/format-stale-output/.gitignore
@@ -0,0 +1 @@
!dist
63 changes: 63 additions & 0 deletions .github/actions/format-stale-output/README.md
@@ -0,0 +1,63 @@
# format-stale-output

Format the output of actions/stale into something you can pass to pullreminders/slack-action as blocks.

## Inputs

### `staled-issues-prs`

Comes from [actions/stale](https://github.com/actions/stale).

### `closed-issues-prs`

Comes from [actions/stale](https://github.com/actions/stale).

## Outputs

### `blocks`

Something you can directly pass to [pullreminders/slackaction](https://github.com/abinoda/slack-action) like:

```yaml
- name: Slack Report Closed Issues
uses: pullreminders/slack-action@v1.0.7
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_TOKEN }}
with:
args: '{\"channel\": \"${{ secrets.SLACK_STALE_CHANNEL_ID }}\", \"text\": \"\", \"blocks\": ${{ steps.format-stale-output.outputs.blocks }} }'
```

## Example Usage

```yaml
name: Stale Bot
on:
schedule:
- cron: "0 */12 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
name: stale
id: stale
with:
days-before-stale: 20
days-before-close: 40
- name: Format Stale Output
id: format-stale-output
uses: ./.github/actions/format-stale-output
with:
staled-issues-prs: ${{ steps.stale.outputs.staled-issues-prs }}
closed-issues-prs: ${{ steps.stale.outputs.closed-issues-prs }}
- name: Slack Report Closed Issues
uses: pullreminders/slack-action@v1.0.7
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_TOKEN }}
with:
args: '{\"channel\": \"${{ secrets.SLACK_STALE_CHANNEL_ID }}\", \"text\": \"\", \"blocks\": ${{ steps.format-stale-output.outputs.blocks }} }'
```

## Building this Action

Use [`@vercel/ncc`](https://github.com/vercel/ncc) to compile this action. You can run `npm run build` in this directory to run the command.
15 changes: 15 additions & 0 deletions .github/actions/format-stale-output/action.yml
@@ -0,0 +1,15 @@
name: Format Stale output
description: Format the output of actions/stale into something you can pass to pullreminders/slack-action as blocks
inputs:
staled-issues-prs:
description: List of all staled issues and pull requests.
required: true
closed-issues-prs:
description: List of all closed issues and pull requests.
required: true
outputs:
blocks:
description: Contents you can pass into "blocks" of slack-action
runs:
using: "node12"
main: "dist/index.js"

0 comments on commit fd54ceb

Please sign in to comment.