Skip to content

Update README with instructions for forks#93

Merged
stefanzweifel merged 3 commits intomasterfrom
add-note-about-forks
Aug 22, 2020
Merged

Update README with instructions for forks#93
stefanzweifel merged 3 commits intomasterfrom
add-note-about-forks

Conversation

@stefanzweifel
Copy link
Copy Markdown
Owner

@stefanzweifel stefanzweifel commented Aug 22, 2020

GitHub recently introduced ways for Actions to run on forks.
This update now finally allows repository maintainers to write Workflows to run code linters and fixers which can also work on the forks.


This PR updates our documentation with instructions on how to enable GitHub Actions for forks and how to update your Workflows to run on forks.

I've added an example for forks of public repositories, as that combination is more common. For forks of private repositories I've basically added what GitHub recommends doing.

This is the pull request from my test application to test things out: stefanzweifel/git-auto-commit-action-demo-app#15
This is the Actions log on the forked repository: https://github.com/wnxtrash/git-auto-commit-action-demo-app/actions?query=workflow%3A%22Format+PHP%22

This PR closes #90 and also brings a permanent solution for #25.

TODOs

  • Add Screenshot

Screenshot_2020-08-22 Use pull_request_target by wnxtrash · Pull Request #15 · stefanzweifel git-auto-commit-action-demo-app(1)

stefanzweifel and others added 2 commits August 22, 2020 14:13
GitHub recently introduced ways for Actions to run on forks.

This update now finally allows repository maintainers to write Workflows to run code linters and fixers which can also work on the forks.
@stefanzweifel
Copy link
Copy Markdown
Owner Author

Just my 2 cents:

It's good to see, that GitHub addressed the problem Actions like git-auto-commit have when running in forks. For example running tool like php-cs-fixer in a open source project before this change was only really possible when listening to the push-event for the master branch.

With the addition of pull_request_target it's now possible for forks to run those Workflows too. However, contributors have to go through hoops to get it working:

  • They have to explicitly enable GitHub Actions in the "Actions"-tab after they've forked the repository (to make sure that the new forked repository doesn't eat their free GitHub Actions minutes)
  • The running workflows are not visible in the status indicator and the end of the pull request, as their run in the fork and not in the repository the pull request is opened at.

As I said, it's cool that it's possible to run the Action on forks, but I wouldn't recommend doing it to anyone. It's probably safer to just use a "push on master" trigger for your projects. 🤷

@stefanzweifel stefanzweifel merged commit 303ce37 into master Aug 22, 2020
@stefanzweifel stefanzweifel deleted the add-note-about-forks branch August 22, 2020 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update docs to mention improvements for fork and pull_request workflows

1 participant