No description
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-05 16:19:33 +00:00
action.yml As in geut, 3 file(s) changed 2026-11-05 16:19:33 +00:00
index.mjs As in geut, 3 file(s) changed 2026-11-05 16:19:33 +00:00
README.md As in geut, 3 file(s) changed 2026-11-05 16:19:33 +00:00

github-compat

A Forgejo Actions action for jobs written against GitHub Actions: it sets the default variables (2026-11-05) that Forgejo's runner leaves out, for the steps after it, and prints every variable on GitHub's list with its value. A JavaScript action (index.mjs, no dependencies), run on the job image's Node, as gitlab-compat is.

It reads what Forgejo tells a job: the event that started it ($GITHUB_EVENT_PATH) and the forge's API, with the job's token. A variable it cannot know is left unset rather than made up.

Inputs

Input Default For
server-url the forge's URL, its first label github for git: https://github.local.branchhaus.eu github-shim, GitHub's face for the forge: GITHUB_GRAPHQL_URL
token ${{ github.token }} what the API is read with

What it sets

Variable From
GITHUB_REPOSITORY_ID, GITHUB_REPOSITORY_OWNER_ID the repository's and its owner's ids
GITHUB_ACTOR_ID the event's sender, when it is the actor; else the actor's user
GITHUB_TRIGGERING_ACTOR GITHUB_ACTOR: Forgejo keeps no one apart for a re-run
GITHUB_REF_PROTECTED the branch's protection; for a tag, whether the repository protects any
GITHUB_WORKFLOW_SHA GITHUB_SHA: Forgejo reads the workflow from the commit the job runs on
GITHUB_GRAPHQL_URL server-url + /api/graphql: Forgejo has no GraphQL
RUNNER_ENVIRONMENT self-hosted

Any of them Forgejo already sets is left as it is.

What Forgejo sets itself (runner 13.2.1, withGithubEnv and step.go): CI, GITHUB_ACTION, _ACTION_PATH, _ACTION_REPOSITORY, GITHUB_ACTIONS, GITHUB_ACTOR, GITHUB_API_URL (the forge's /api/v1), GITHUB_BASE_REF, GITHUB_HEAD_REF, GITHUB_ENV, _OUTPUT, _PATH, _STEP_SUMMARY, GITHUB_EVENT_NAME, _EVENT_PATH, GITHUB_JOB, GITHUB_REF, _REF_NAME, _REF_TYPE, GITHUB_REPOSITORY, _REPOSITORY_OWNER, GITHUB_RETENTION_DAYS, GITHUB_RUN_ATTEMPT, _RUN_ID, _RUN_NUMBER, GITHUB_SERVER_URL, GITHUB_SHA, GITHUB_WORKFLOW, _WORKFLOW_REF, GITHUB_WORKSPACE, RUNNER_ARCH, _OS, _TEMP, _TOOL_CACHE. It sets them again at every step, after what $GITHUB_ENV holds, so none of them can be changed from here: GITHUB_API_URL stays the forge's, not github-shim's.

Not set: RUNNER_NAME, which neither the job nor the API tells; RUNNER_DEBUG, which GitHub sets only with debug logging, which Forgejo does not have.

What it prints

Every variable on GitHub's list, in its order, as NAME=value, or NAME (unset). None of them is a secret. The per-step ones, as GITHUB_ACTION and GITHUB_OUTPUT, are this action's own step's.

Referring to it

geut.sh forgejo-configure puts this directory on the forge as the public repository actions/github-compat, v1 on its head (the forgejo component's README, "Actions"):

steps:
  - uses: actions/checkout@v4
  - uses: actions/github-compat@v1
  - run: echo "$GITHUB_REPOSITORY ($GITHUB_REPOSITORY_ID), protected: $GITHUB_REF_PROTECTED"

A change here reaches the forge at the next forgejo-configure, which moves v1 to it.