-
Notifications
You must be signed in to change notification settings - Fork 541
Error: Unhandled error: TypeError: Cannot read properties of undefined (reading 'get') #492
-
Run actions/github-script@v6.1.0
TypeError: Cannot read properties of undefined (reading 'get')
Error: Unhandled error: TypeError: Cannot read properties of undefined (reading 'get')
at eval (eval at callAsyncFunction (/Users/runner/work/_actions/actions/github-script/v6.1.0/dist/index.js:4807:16), :5:50)
at callAsyncFunction (/Users/runner/work/_actions/actions/github-script/v6.1.0/dist/index.js:4808:12)
at main (/Users/runner/work/_actions/actions/github-script/v6.1.0/dist/index.js:4862:26)
at 272 (/Users/runner/work/_actions/actions/github-script/v6.1.0/dist/index.js:4846:1)
at webpack_require (/Users/runner/work/_actions/actions/github-script/v6.1.0/dist/index.js:24:31)
at startup (/Users/runner/work/_actions/actions/github-script/v6.1.0/dist/index.js:43:19)
at /Users/runner/work/_actions/actions/github-script/v6.1.0/dist/index.js:49:18
at Object. (/Users/runner/work/_actions/actions/github-script/v6.1.0/dist/index.js:52:10)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
- name: Log Review Event
run: echo "A review was submitted to the pull request."
- name: Check PR milestone
id: check-milestone
uses: actions/github-script@v6.1.0
with:
script: |
const { owner, repo } = context.repo;
const pull_number = context.payload.pull_request.number;
const { data: pullRequest } = await github.pulls.get({
owner,
repo,
pull_number
});
const requiredMilestone = 'v-532'; // Replace with the current milestone name
if (!pullRequest.milestone || pullRequest.milestone.title !== requiredMilestone) {
core.setOutput('run', 'false');
} else {
core.setOutput('run', 'true');
- name: Move PR to '1 approval done' column
if: steps.check-milestone.outputs.run == 'true'
run: python .github/scripts/move_to_one_approval.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
This worked before for me, but started happening when I changed the default branch. Is there any way to fix it?
Beta Was this translation helpful? Give feedback.