{"id":17816491,"url":"https://github.com/zebrajaeger/github-trigger-server","last_synced_at":"2025-04-02T08:26:06.900Z","repository":{"id":97328916,"uuid":"389884040","full_name":"zebrajaeger/github-trigger-server","owner":"zebrajaeger","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-29T05:30:33.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T23:43:01.936Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zebrajaeger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-27T07:13:43.000Z","updated_at":"2021-07-29T05:30:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"9e94b2f1-ae74-45d0-bb8b-02109e3ac41e","html_url":"https://github.com/zebrajaeger/github-trigger-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebrajaeger%2Fgithub-trigger-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebrajaeger%2Fgithub-trigger-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebrajaeger%2Fgithub-trigger-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebrajaeger%2Fgithub-trigger-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zebrajaeger","download_url":"https://codeload.github.com/zebrajaeger/github-trigger-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246779932,"owners_count":20832488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-27T16:38:16.233Z","updated_at":"2025-04-02T08:26:06.879Z","avatar_url":"https://github.com/zebrajaeger.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github-trigger-server\n\nreceiver for a github curl trigger\n\n# Configure github repo\n\ncreate a file \n\n    .github/workflows/trigger.yml\n \nand fill with content (replace \u0026lt;myserver\u0026gt; with your server host/path):\n\n```yaml\non: push\njobs:\n  curl:\n    runs-on: ubuntu-latest\n    env:\n      GH_REPO: 'repo={{ github.repository }}'\n      GH_SHA: 'sha=${{ github.sha }}'\n      GH_REF: 'ref=${{ github.ref }}'\n      GH_TOKEN: 'key='${{ github.token }}'\n    steps:\n    - name: curl\n      uses: wei/curl@v1\n      with:\n        args: -X POST -d $GH_REPO -d $GH_SHA -d $GH_REF -d GH_TOKEN https://\u003cmyserver\u003e\n```\n\nThat sends a \n## configure server\n\n### code\n\nclone this repo\n\n    git clone https://github.com/zebrajaeger/github-trigger-server.git\n\ncreate a config (ignored by git)\n\n    cd github-trigger-server\n    nano config.json\n\nand fill with content (replace with your data):\n```json\n{\n    \"repo\": \"zebrajaeger/website\",\n    \"ref\": \"refs/heads/release\",\n    \"onlyLastTrigger\": true,\n    \"command\": \"node /home/zebrajaeger/website/install/index.js\",\n    \"key\": \"****\",\n    \"port\": 4444\n}\n```\n\nYou can ignore repo, ref and key. \nThat means the server ignores the request parameter. \nOtherwise, it compares the config and request value and only triggers the command if both values have exact the same value.\n\nI strongly recommend put this server behind a reverse proxy (like nginx). \nThat also has the advantage to use [Letsencrypt](https://letsencrypt.org/) for a https connection.  \n\n### Nginx with letsencrypt (optional but recommended)\n\nFollow the steps in this document:\n\n- https://www.nginx.com/blog/using-free-ssltls-certificates-from-lets-encrypt-with-nginx/\n\nA site configuration with Letencrpy my look like this (replaced %lt;myserver\u0026gt; with your server name, also the port 4444):\n\n    server {\n        root /var/www/\u003cmyserver\u003e;\n        index index.html;\n        server_name \u003cmyserver\u003e;\n        \n        listen [::]:443 ssl; # managed by Certbot\n        listen 443 ssl; # managed by Certbot\n        ssl_certificate /etc/letsencrypt/live/\u003cmyserver\u003e/fullchain.pem; # managed by Certbot\n        ssl_certificate_key /etc/letsencrypt/live/\u003cmyserver\u003e/privkey.pem; # managed by Certbot\n        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot\n        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot\n    \n        location / {\n            proxy_http_version 1.1;\n            proxy_cache_bypass $http_upgrade;\n\n            proxy_set_header Upgrade $http_upgrade;\n            proxy_set_header Connection 'upgrade';\n            proxy_set_header Host $host;\n            proxy_set_header X-Real-IP $remote_addr;\n            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n            proxy_set_header X-Forwarded-Proto $scheme;\n\n            proxy_pass http://localhost:4444;\n        }\n    }\n\n    server {\n        if ($host = \u003cmyserver\u003e) {\n        return 301 https://$host$request_uri;\n        } # managed by Certbot\n    \n    \n        listen 80;\n        listen [::]:80;\n        server_name \u003cmyserver\u003e;\n        return 404; # managed by Certbot\n    }\n\n\n## Test\n\nlocal test (http)\n\n    curl -v -X POST -d 'repo=zebrajaeger/website' -d 'ref=refs/heads/release' -d 'key=1234' localhost:4444\n\nvia proxy (https)\n\n    curl -v -X POST -d 'repo=zebrajaeger/website' -d 'ref=refs/heads/release' -d 'key=1234' https://\u003cmyserver\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzebrajaeger%2Fgithub-trigger-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzebrajaeger%2Fgithub-trigger-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzebrajaeger%2Fgithub-trigger-server/lists"}