Skip to content

Commit

Permalink
fix: pr number
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris committed Mar 7, 2020
1 parent e154301 commit 48c03e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
ref: master
- name: Commenter
uses: peaceiris/[email protected].1
uses: peaceiris/[email protected].2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
config_file: .github/commenter_test_1.yml
13 changes: 10 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ export async function run(): Promise<void> {

console.log(context);

const eventName = context.eventName;
const labelEvent = context.payload.action;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const labelName = (context.payload as any).label.name;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const issueNumber = (context.payload as any).issue.number;
let issueNumber = '';
if (eventName === 'issues') {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
issueNumber = (context.payload as any).issue.number;
} else if (eventName === 'pull_request') {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
issueNumber = (context.payload as any).number;
}

core.info(`\
[INFO] config_file: ${inps.ConfigFilePath}
[INFO] labelName: ${labelName}
Expand Down Expand Up @@ -83,7 +91,6 @@ export async function run(): Promise<void> {
);
}

const eventName = context.eventName;
let eventType = '';
if (eventName === 'issues') {
eventType = 'issue';
Expand Down

0 comments on commit 48c03e1

Please sign in to comment.