Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow run on pull_request_target #287

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
FROM alpine:3.19 AS base

# hadolint ignore=DL3018
RUN apk add --no-cache --update nodejs=18.18.2-r0
RUN apk add --no-cache --update nodejs=20.12.1-r0

WORKDIR /action

Expand All @@ -16,7 +16,7 @@ ENTRYPOINT [ "node" ]
FROM base AS build

# hadolint ignore=DL3018
RUN apk add --no-cache npm=9.6.6-r0
RUN apk add --no-cache npm=10.2.5-r0

# slience npm
# hadolint ignore=DL3059
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const lint = require('./lint.js')
const messageProps = { title: 'commit-lint' }

// exit early
if (!['pull_request', 'push'].includes(github.context.eventName)) {
if (!['pull_request', 'pull_request_target', 'push'].includes(github.context.eventName)) {
core.warning(`action ran on unsupported event: ${github.context.eventName}`, messageProps)
process.exit(0) // soft exit
}
Expand Down Expand Up @@ -45,7 +45,7 @@ const commits = []

async function main () {
// handle Pul Requests
if (github.context.eventName === 'pull_request') {
if (['pull_request', 'pull_request_target'].includes(github.context.eventName)) {
// fetch commits
const { data } = await octokit.rest.pulls.listCommits({
...github.context.repo,
Expand Down
Loading