Skip to content

Commit

Permalink
Notification for pending release (#15)
Browse files Browse the repository at this point in the history
Action which notifies after a release becomes stale
Co-authored-by: Sameer Srivastava <[email protected]>
  • Loading branch information
sameer-coder authored May 3, 2021
1 parent b4efc57 commit 798fc9c
Show file tree
Hide file tree
Showing 24 changed files with 5,382 additions and 3,787 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"extends": "eslint:recommended",
"env": {
"node": true,
"es6": true
"es6": true,
"commonjs": true,
"jest": true
},
"parserOptions": {
"sourceType": "script",
Expand Down
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
uses: actions/checkout@v2
uses: actions/[email protected]
with:
node-version: 14
run: npm i
run: npm run lint
run: npm test
automerge:
needs: build
runs-on: ubuntu-latest
steps:
- uses: fastify/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
9 changes: 3 additions & 6 deletions .github/workflows/notify-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: notify-pending-release
name: notify-release
on:
workflow_dispatch:
branches:
Expand All @@ -9,12 +9,9 @@ jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Check if there's a release pending
id: notify
uses: estherixz/github-action-notify-release@main
uses: nearform/github-action-notify-release@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
stale-days: 0
69 changes: 69 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# postgres data files
pgdata

# gcp service account key
key.json

.env
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm test
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Configure this action in your workflows providing the inputs described below in
### `github-token`
**Required** A GitHub token. See below for additional information.

### `days-to-stale-release`
### `stale-days: 7`
_Optional_ The number of days after which unreleased commits should be considered stale and should notify for a release. Default is `7`.

## Notes
Expand All @@ -17,7 +17,7 @@ _Optional_ The number of days after which unreleased commits should be considere

## Example
```
name: notify-pending-release
name: notify-release
on:
workflow_dispatch:
branches:
Expand All @@ -28,15 +28,9 @@ jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Check if there's a release pending
id: notify
uses: estherixz/github-action-notify-release@main
- name: Notify release
uses: nearform/github-action-notify-release@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
days-to-stale-release: 7
stale-days: 7
```
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: 'Notify for pending release'
name: 'Github Action Notify Release'
description: 'Create an issue if there is a release pending'
inputs:
github-token:
description: 'GitHub token'
required: true
days-to-stale-release:
description: 'The number of days after which notification should trigger after last unreleased commit'
required: true
stale-days:
description: 'Number of days of inactivity before a release becomes stale'
required: false
default: 7
runs:
using: 'node12'
Expand Down
Loading

0 comments on commit 798fc9c

Please sign in to comment.