mirror of
https://github.com/ButlerLogic/action-autotag.git
synced 2024-11-22 08:11:07 +07:00
Add support for both with and env for secrets.
This commit is contained in:
parent
651af18eed
commit
76fc4634c5
@ -22,15 +22,10 @@ async function run() {
|
||||
core.debug(` Working Directory: ${process.env.GITHUB_WORKSPACE}:\n${dir}`)
|
||||
|
||||
if (!process.env.hasOwnProperty('GITHUB_TOKEN')) {
|
||||
const gh_token = core.getInput('GITHUB_TOKEN', { required: true })
|
||||
|
||||
if (!gh_token) {
|
||||
if (!process.env.hasOwnProperty('INPUT_GITHUB_TOKEN')) {
|
||||
core.setFailed('Invalid or missing GITHUB_TOKEN.')
|
||||
return
|
||||
}
|
||||
|
||||
core.warning('Using `with:\n\tGITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}` is deprecated. See README for new syntax.')
|
||||
process.env.GITHUB_TOKEN = gh_token
|
||||
}
|
||||
|
||||
const pkg_root = core.getInput('package_root', { required: false })
|
||||
@ -45,7 +40,7 @@ async function run() {
|
||||
core.debug(` Detected version ${pkg.version}`)
|
||||
|
||||
// Check for existing tag
|
||||
const git = new github.GitHub(process.env.GITHUB_TOKEN)
|
||||
const git = new github.GitHub(process.env.INPUT_GITHUB_TOKEN || process.env.GITHUB_TOKEN)
|
||||
const owner = process.env.GITHUB_ACTOR
|
||||
const repo = process.env.GITHUB_REPOSITORY.split('/').pop()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user