Skip to content

Commit

Permalink
fixed action (#15)
Browse files Browse the repository at this point in the history
* fixed action

* add shell
  • Loading branch information
okuzawats authored Sep 15, 2022
1 parent e86914c commit 12364b1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 29 deletions.
10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

24 changes: 17 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,20 @@ inputs:
required: true
description: 'Message to send'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.apiToken }}
- ${{ inputs.roomId }}
- ${{ inputs.title }}
- ${{ inputs.message }}
using: 'composite'
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.0'
- run: ruby $GITHUB_ACTION_PATH/main.rb
shell: sh
env:
API_TOKEN: ${{ inputs.apiToken }}
ROOM_ID: ${{ inputs.roomId }}
TITLE: ${{ inputs.title }}
MESSAGE: ${{ inputs.message }}
8 changes: 0 additions & 8 deletions entrypoint.sh

This file was deleted.

8 changes: 4 additions & 4 deletions send_message.rb → main.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'net/http'

params = {
token: ARGV[0],
room_id: ARGV[1],
title: ARGV[2][1, ARGV[2].length - 2],
message: ARGV[3][1, ARGV[3].length - 2]
token: ENV['API_TOKEN'],
room_id: ENV['ROOM_ID'],
title: ENV['TITLE'],
message: ENV['MESSAGE']
}

uri = URI.parse("https://api.chatwork.com/v2/rooms/#{params[:room_id]}/messages")
Expand Down

0 comments on commit 12364b1

Please sign in to comment.