Skip to content

Pull Request Automation: Avoid automation tasks for forked repository#20021

Merged
talldan merged 2 commits intomasterfrom
remove/pr-automation-add-first-contribution
Feb 4, 2020
Merged

Pull Request Automation: Avoid automation tasks for forked repository#20021
talldan merged 2 commits intomasterfrom
remove/pr-automation-add-first-contribution

Conversation

@aduth
Copy link
Copy Markdown
Member

@aduth aduth commented Feb 4, 2020

Related: #17324

This pull request seeks to avoid running automation tasks for pull request events when the event was triggered by a pull request originated from a forked repository. Based on the comment at #17324 (comment), events which trigger from forked repositories are run with read-only permissions, and as such are not allowed to add labels, resulting in errors for tasks which perform these actions.

Testing Instructions:

The actions associated with this pull request should be expected to run fully and successfully, since it does not originate from a fork repository.

@aduth aduth added [Type] Bug An existing feature does not function as intended [Type] Project Management Meta-issues related to project management of Gutenberg labels Feb 4, 2020
@aduth aduth requested a review from talldan February 4, 2020 00:56
@aduth
Copy link
Copy Markdown
Member Author

aduth commented Feb 4, 2020

The actions associated with this pull request should be expected to run fully and successfully, since it does not originate from a fork repository.

See https://github.com/WordPress/gutenberg/runs/424412032?check_suite_focus=true

main: Received event = 'pull_request', action = 'opened'
main: Starting task assignFixedIssues
main: Starting task addFirstTimeContributorLabel
add-first-time-contributor-label: Searching for commits in WordPress/gutenberg by @aduth
add-first-time-contributor-label: 1598 commits found. Aborting
main: All done!

Copy link
Copy Markdown
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for tackling it so swiftly.

@talldan talldan merged commit 02ce73f into master Feb 4, 2020
@talldan talldan deleted the remove/pr-automation-add-first-contribution branch February 4, 2020 04:14
@github-actions github-actions bot added this to the Gutenberg 7.5 milestone Feb 4, 2020
@talldan
Copy link
Copy Markdown
Contributor

talldan commented Feb 4, 2020

The action was skipped successfully here: https://github.com/WordPress/gutenberg/pull/20025/checks

@aduth
Copy link
Copy Markdown
Member Author

aduth commented Feb 4, 2020

@talldan That's great! It occurs to me, looking at the log, there are two things we can improve:

  • It would be nice if the condition added through this higher-order function would output some debugging message for when it is skipping a task.
  • I missed the fact that the 'Starting task' relied on Function#name in order to output the name of the task being started, which no longer works with the higher-order function wrapper.

I created #20031 for tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Bug An existing feature does not function as intended [Type] Project Management Meta-issues related to project management of Gutenberg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants