Skip to content

Commit

Permalink
fix to use token from input
Browse files Browse the repository at this point in the history
  • Loading branch information
ppremk committed Oct 2, 2020
1 parent f6cd663 commit 36ec3bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- name: Get Repo Code
id: get_repo_code
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: LFS Warning
id: lfs_warning
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: 'LFS-warning'
description: 'Checks file sizes in a Pull Request and warns of large files'
inputs:
token:
required: false
description: Token used to fetch the repository
default: ${{ github.token }}
filesizelimit: # id of input
description: 'file size limit threshold'
required: true
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const core = require("@actions/core")
const github = require("@actions/github")

const octokit = new github.GitHub(process.env.GITHUB_TOKEN)
const myToken = core.getInput('token')
const octokit = new github.GitHub(myToken)

const context = github.context

const { owner, repo } = context.repo
Expand Down

0 comments on commit 36ec3bd

Please sign in to comment.