Skip to content

Commit 902e377

Browse files
fix breaking dependency issues introduced in v3.2.0 (#149)
1 parent a9b965d commit 902e377

File tree

9 files changed

+1217
-25
lines changed

9 files changed

+1217
-25
lines changed

action.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ import ActionPolicy from './utils/ActionPolicy'
1717
const allowList = getInput('allow_list_path')
1818
const workspace = process.env.GITHUB_WORKSPACE
1919

20+
if (!workspace) {
21+
throw new Error('❗ GITHUB_WORKSPACE environment variable is not set')
22+
}
23+
2024
const allowListPath = join(workspace, allowList)
2125
const {dir} = parse(allowListPath)
2226

dist/index.js

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/licenses.txt

Lines changed: 1166 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sourcemap-register.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 25 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "github-actions-allow-list-as-code-action",
33
"version": "3.2.0",
4-
"type": "module",
54
"description": "Automate GitHub Actions allow list for GitHub Enterprise Cloud and Server accounts",
65
"keywords": [
76
"github-enterprise-cloud",

readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ actions:
6161
- azure/*
6262
```
6363

64+
## Local Development
65+
66+
To run locally, set the following environment variables, compile with `ncc`, and run with `node`:
67+
68+
```sh
69+
export GITHUB_WORKSPACE=$(pwd)
70+
export INPUT_ALLOW_LIST_PATH=allowlist.yml
71+
export INPUT_ORGANIZATION=my-org # use INPUT_ENTERPRISE for enterprise
72+
export INPUT_TOKEN=ghp_abcdefg
73+
npm run build
74+
node dist/index.js
75+
```
76+
6477
## License
6578

6679
- [MIT License](./license)

utils/ActionPolicy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import {readFileSync} from 'fs'
22
import {GitHub, getOctokitOptions} from '@actions/github/lib/utils'
33
import {enterpriseCloud} from '@octokit/plugin-enterprise-cloud'
4-
import {enterpriseServer312Admin} from '@octokit/plugin-enterprise-server'
4+
import {enterpriseServer315Admin} from '@octokit/plugin-enterprise-server'
55
import {load} from 'js-yaml'
66
import {ProxyAgent} from 'proxy-agent'
77

88
const MyOctokit = GitHub.defaults({
99
headers: {'X-Github-Next-Global-ID': 1},
1010
request: {agent: new ProxyAgent()},
1111
userAgent: 'github-actions-allow-list-as-code',
12-
}).plugin(enterpriseCloud, enterpriseServer312Admin)
12+
}).plugin(enterpriseCloud, enterpriseServer315Admin)
1313

1414
class ActionPolicy {
1515
/**

0 commit comments

Comments
 (0)