Skip to content

Commit

Permalink
feat: Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshCoady committed Jun 12, 2020
1 parent d176d91 commit 16d8a83
Show file tree
Hide file tree
Showing 325 changed files with 28,160 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 100
tab_width = 2
17 changes: 17 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
}
}
78 changes: 78 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CICD

on:
pull_request:
push:
branches:
- master

jobs:
test:
strategy:
matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.runs-on }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Convert
id: convert
uses: ./
with:
text: |
# Heading 1
## Heading 2
[Link](http://example.com)
* List Item 1
* List Item 2
- name: Verify
shell: bash
env:
ACTUAL: ${{ steps.convert.outputs.text }}
EXPECTED: |
*Heading 1*
*Heading 2*
<http://example.com|Link>
• List Item 1
• List Item 2
run: |
if [ "$ACTUAL" != "$EXPECTED" ]; then
echo "Actual: $ACTUAL"
echo "Expected: $EXPECTED"
exit 1
fi
release:
needs: test
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Release
id: release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update major version tag
if: steps.release.outputs.new_release_published == 'true'
env:
TAG: v${{ steps.release.outputs.new_release_major_version }}
run: |
git tag "$TAG"
git push origin "$TAG"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
.vscode
12 changes: 12 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"branches": [
"master"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/git",
"@semantic-release/github"
]
}
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# slackify-markdown-action
GitHub Action to convert markdown into Slack's mrkdwn.

## Usage

### Inputs

* `text` - The markdown text to convert.

### Outputs

* `text` - The markdown text converted to Slack's mrkdwn format.
16 changes: 16 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Slack Markdown Converter'
author: 'Joshua Coady'
description: "Converts markdown to Slack's mrkdwn"
inputs:
text:
description: 'Markdown text to convert'
required: true
outputs:
text:
description: 'Converted Slack mrkdwn text'
runs:
using: 'node12'
main: 'index.js'
branding:
icon: 'heart'
color: 'red'
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const core = require('@actions/core');
const slackifyMarkdown = require('slackify-markdown');

try {
const md = core.getInput('text', {required: true});
const mrkdwn = slackifyMarkdown(md);
core.setOutput("text", mrkdwn);
} catch (error) {
core.setFailed(error.message);
}
146 changes: 146 additions & 0 deletions node_modules/@actions/core/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions node_modules/@actions/core/lib/command.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 16d8a83

Please sign in to comment.