Skip to content

Commit

Permalink
First release
Browse files Browse the repository at this point in the history
  • Loading branch information
delmendo committed May 6, 2020
1 parent 7c5d2bf commit 6c2a12f
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tag.sh
docker_build.sh
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
message.json
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

FROM alpine:3.11

RUN apk add --no-cache ca-certificates bash curl jq

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
9 changes: 8 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 r26D
Copyright (c) 2020 r26D, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,3 +19,10 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

This project includes code that was originally produced by GitHub Actions. That
license is displayed in LICENSE.GitHubActions

This project includes code that was originally produced by David Tesar.
That license is displayed in LICENSE.DavidTesar

21 changes: 21 additions & 0 deletions LICENSE.GitHubActions
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 GitHub Actions

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# JQ Action

This lets you run jq commands


## Inputs
### `cmd`
**Required** This is the actual command that will be passed along

## Example usage

```yaml
uses: r26d/jq-action@master
with:
cmd: jq -n env

```
13 changes: 13 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'JQ Action'
description: 'This action makes it easy to run jq as an action'
inputs:
cmd:
description: 'The command that should be run'
required: true
runs:
using: 'docker'
#image: 'Dockerfile'
image: "docker://delmendo/yq-action:latest"
args:
- ${{ inputs.cmd }}
- ${{ inputs.working_directory }}
6 changes: 6 additions & 0 deletions docker_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

docker build -t "delmendo/slack-action:v${1}" .
docker build -t delmendo/slack-action:latest .
docker push delmendo/slack-action:latest
docker push "delmendo/slack-action:v${1}"
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

jq $CMD
7 changes: 7 additions & 0 deletions tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

git commit -a -m "${1}"
git tag -a -m "${1}" "v${2}"
git push --follow-tags

./docker_build.sh $2
19 changes: 19 additions & 0 deletions test_runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -e
VERSION="2.0.2"
export SLACK_WEBHOOK_URL="" #Set this for testing.
export INPUT_USERNAME="Github Action"
export INPUT_ICONEMOJI=":gatsby:"
export INPUT_CHANNEL="#jobward_development"
export INPUT_HEADLINE="This is a test"
export INPUT_BODY="Starting the process to build and deploy the *Public Web Site*"
export INPUT_IMAGEURL="https://bit.ly/3d82tTU"

echo $INPUT_HEADLINE
/usr/bin/docker run --name delmendoslackactionlatest_647d79 --label c27d31 --workdir /github/workspace --rm \
-e SLACK_WEBHOOK_URL -e INPUT_USERNAME -e INPUT_ICONEMOJI -e INPUT_CHANNEL -e INPUT_HEADLINE -e INPUT_BODY -e INPUT_IMAGEURL \
-e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID \
-e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE \
-e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL \
-e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true delmendo/slack-action:v${VERSION}

0 comments on commit 6c2a12f

Please sign in to comment.