Skip to content

Commit

Permalink
update entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
RoryQ committed Apr 22, 2024
1 parent 0d8987a commit b7e44bf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
go-version: stable
- run: go run main.go
env:
INPUT_REQUIRED: |
INPUT_REQUIRED_WORKFLOW_PATTERNS: |
- tests
INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 8 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ description: Define required checks inside your repository.
author: "Rory Quinn"

inputs:
github_token:
description: Required.
token:
description: GitHub token
required_workflow_patterns:
description: List of patterns to check.
target_sha:
description: Target SHA.
initial_delay_seconds:
description: Initial delay before polling.
poll_frequency_seconds:
description: Polling frequency.
version:
description: Release version of action to run.
runs:
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const os = require('os')
const process = require('process')

const OwnerRepo = "RoryQ/required-checks"
const BinaryName = "required_checks"
const BinaryName = "required-checks"

function logDebug(...data) {
if (!!process.env.REQUIRED_CHECKS_DEBUG) {
Expand Down Expand Up @@ -63,7 +63,7 @@ function determineVersion() {
}

function main() {
logDebug(process.env.INPUT_PATHS)
logDebug(process.env.INPUT_REQUIRED)
logDebug("started")
const versionTag = determineVersion()
let status = downloadBinary(versionTag, chooseBinary(versionTag))
Expand Down
10 changes: 5 additions & 5 deletions pkg/reqcheck/inputs/inputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ package inputs

const (
// Token required for the GitHub API
Token = "token"
Token = "TOKEN"

// RequiredWorkflowPatterns is a yaml list of patterns to check
RequiredWorkflowPatterns = "required"
RequiredWorkflowPatterns = "REQUIRED_WORKFLOW_PATTERN"

// InitialDelaySeconds Initial delay before polling
InitialDelaySeconds = "initial-delay-seconds"
InitialDelaySeconds = "INITIAL_DELAY_SECONDS"

// PollFrequencySeconds Polling frequency
PollFrequencySeconds = "poll-frequency-seconds"
PollFrequencySeconds = "POLL_FREQUENCY_SECONDS"

TargetSHA = "target-sha"
TargetSHA = "TARGET_SHA"

// Version release version of the action to run
Version = "version"
Expand Down

0 comments on commit b7e44bf

Please sign in to comment.