graylog-deploy/.forgejo/workflows/deploy.yml
byrsapty 3e46b08db5 CI: authenticate the deploy clone so it keeps working once the repo is private
Forgejo auto-issues a per-job, repo-scoped secrets.GITHUB_TOKEN (created at
workflow start, destroyed at completion, usable only against this repo);
use it in the clone URL instead of an anonymous HTTPS clone, which would
start failing with 401/403 the moment the repo's visibility changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-22 21:42:36 +03:00

27 lines
1.2 KiB
YAML

name: Deploy Graylog config
on:
workflow_dispatch:
jobs:
deploy:
runs-on: self-hosted
steps:
# Plain git clone instead of actions/checkout@v4: that action is a
# Node.js-based action, and this runner executes in host mode (no
# Docker) directly on the Graylog appliance container, which has no
# Node.js installed and shouldn't need one just for CI checkout.
- name: Deploy
env:
GRAYLOG_EXTERNAL_URI: http://93.171.241.5:9000/
GRAYLOG_ADMIN_PASSWORD: ${{ secrets.GRAYLOG_ADMIN_PASSWORD }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
# Forgejo issues this automatically per-job, scoped to this repo only -
# needed once the repo is private, since a plain anonymous clone would
# get 401/403. No extra secret to manage: it's provided by the platform.
CI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rm -rf /tmp/graylog-deploy-ci
git clone --depth 1 --branch main "https://x-access-token:${CI_TOKEN}@git.zotac.keenetic.link/zotac/graylog-deploy.git" /tmp/graylog-deploy-ci
cd /tmp/graylog-deploy-ci
chmod +x install-graylog.sh
./install-graylog.sh