-
Notifications
You must be signed in to change notification settings - Fork 459
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
Deploy to GreasyFork from github pipeline #1288
Comments
This is not currently supported. There are two pieces that would be needed for this to work:
|
Thank you for the reply!
As for this - I thought we could trigger webhook with curl request.
Actually I could post the script content as part of the request, so there will be no need to look for it on github or somewhere else. payload='{
"ref": "refs/tags/v2024-07-13",
"before": "a4e6c9625545b2af76743283d1efb9b10504a03e",
"after": "0000000000000000000000000000000000000000",
"repository": {
"id": 826871908,
"name": "chatscroll",
"full_name": "alex1yaremchuk/chatscroll",
"private": false,
"owner": {
"name": "alex1yaremchuk",
"email": "[email protected]"
},
"html_url": "https://github.com/alex1yaremchuk/chatscroll",
"default_branch": "main"
},
"pusher": {
"name": "alex1yaremchuk",
"email": "[email protected]"
},
"created": false,
"deleted": true,
"forced": false
}'
response=$(curl -v -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer githubsecret_here" \
-d "$payload" \
https://greasyfork.org/en/users/1280205-alex1yaremchuk/webhook)
echo "Response code: $response"
if [ "$response" -ne 200 ]; then
echo "Deployment failed with response code $response"
exit 1
fi previous version with passing file contents: script_content=$(cat src/main.js)
response=$(curl -v -s -o /dev/null -w "%{http_code}" -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer github_secret_here" \
-d '{"event_type": "push", "script_content": "'"${script_content}"'"}' \
https://greasyfork.org/en/users/1280205-alexander-yaremchuk/webhook)
echo "Response code: $response"
if [ "$response" -ne 200 ]; then
echo "Deployment failed with response code $response"
exit 1
fi |
Do GitHub actions use the same secret token as webhooks do? |
If I understand your question right - we don't need to trigger actions, github does it by pipeline settings. Github secret stores whatever we put into it, I put there GF token from webhook. Sorry if I got into too much too obvious detail, I just wanted to clarify for mysef as well. Thank you! |
Hi,
I played with webhooks and made it work with github triggering it automatically by itself on push (on tag creation it failed with 406).
But I expected to be able to trigger the webhook by myself from my pipeline after tests succeeded and after I checked the conditions for publishing (like certain tag name).
Haven't found any information on triggering GF webhooks from CI/CD pipeline.
The text was updated successfully, but these errors were encountered: