Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
fixed the random number issue/added instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Shariq Torres committed Dec 28, 2021
1 parent f3ff2e9 commit e3cbead
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
# action_sam_jackson
# Action Sam Jackson


## Purpose

This Github Action was made mainly serve the repo for Samuel Log Jackson, thoug you can use it for your repo as well, if you are a big fan of Samuel L. Jackson.

## Usage

You can add the action to your Action YAML file like so:
`
- uses: lob/action_sam_jackson
with:
message: '<your message />'
token: ${{secrets.GITHUB_TOKEN}}
`

Both the `message` and the `token` parameters are required.






7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ let gifURLs = [

async function runMain(){
try {
let randInt = Math.floor(Math.random() * gifURLs.length - 1)
console.log(randInt)
let message = `<img src="${gifURLs[randInt]}" width="200px" /> \n`
const randInt = function (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
let message = `<img src="${gifURLs[randInt(0, gifURLs.length - 1)]}" width="200px" /> \n`
const octokit = new Octokit({auth: core.getInput('token')})
let res = await octokit.rest.issues.createComment({
issue_number: github.context.payload.issue.number,
Expand Down

0 comments on commit e3cbead

Please sign in to comment.