Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions action.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {join, parse} from 'path'
import {getInput, isDebug, setFailed, setOutput, info} from '@actions/core'
import {getInput, isDebug, setFailed, setOutput, setSecret, info} from '@actions/core'
import ActionPolicy from './utils/ActionPolicy'

// action
;(async () => {
try {
const token = getInput('token', {required: true})
setSecret(token)
const enterprise = getInput('enterprise', {required: false}) || null
Comment thread
stoe marked this conversation as resolved.
const organization = getInput('organization', {required: false}) || null
const ghApiUrl = getInput('gh_api_url', {required: false}) || 'https://api.github.com'
Expand Down Expand Up @@ -39,24 +40,24 @@ import ActionPolicy from './utils/ActionPolicy'
// load current policy
if (enterprise) await ap.loadCurrentEnterpriseActionsPolicy()
if (organization) await ap.loadCurrentOrganizationActionsPolicy()
info(`✅ Loaded Existing GitHub Actions allow list for ${enterprise || organization}`)
info('✅ Loaded Existing GitHub Actions allow list for ' + (enterprise || organization))

// load updated allow list from YAML
await ap.loadAllowListYAML()
info(`✅ Loaded updated allow list from file ${allowListPath}`)
info('✅ Loaded updated allow list from file ' + allowListPath)

// save new policy
if (enterprise) await ap.updateEnterpriseActionsAllowList()
if (organization) await ap.updateOrganizationActionsAllowList()
info(`✅ Updated GitHub Actions allow list for ${enterprise || organization}`)
setOutput('output', `GitHub Actions allow list updated for ${enterprise || organization}`)
info('✅ Updated GitHub Actions allow list for ' + (enterprise || organization))
setOutput('output', 'GitHub Actions allow list updated for ' + (enterprise || organization))
} catch (error) {
if (isDebug()) {
// print stack trace
console.error(error.stack)
}
Comment thread
stoe marked this conversation as resolved.

info(`❗ GitHub Actions allow list update failed with error: ${error.message}`)
info('❗ GitHub Actions allow list update failed with error: ' + error.message)
setFailed(error.message)
}
})()
4 changes: 2 additions & 2 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.