Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
751 views
in Technique[技术] by (71.8m points)

git - How to run post-receive hook on GitHub

how to run a post-receive hook in GitHub?. I know that there is the web-one but I want to write a custom script and do not want to receive a post from github.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The post-receive hook of Github are actually only "WebHooks", to communicate with a web server whenever the repository is pushed to.

For security reason, you cannot run anything on the GitHub server side.


When a push is made to your repository, we'll POST to your URL with a payload of JSON-encoded data about the push and the commits it contained.

You can use Requestbin to test your webhooks.
(check that the JSON actually comes from GitHub though)


Note: since late 2018, you can run actions on GitHub server-side, with GitHub Actions.

Actions are triggered by GitHub platform events directly in a repo and run on-demand workflows as autoscaled containers in response.
With GitHub Actions you can automate your workflow from idea to production.

See examples with sdras/awesome-actions.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...