Skip to content

Add GitHub Actions OIDC workflow for Pomerium verification - #1

Merged
ssveta7ak merged 6 commits into
mainfrom
copilot/github-actions-authentication
Aug 12, 2026
Merged

ssveta7ak merged 6 commits into
mainfrom
copilot/github-actions-authentication

Conversation

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

This adds a GitHub Actions workflow that opens https://verify.sv.sandbox.pomerium.io using a GitHub-issued OIDC JWT. The workflow is intended to exercise Pomerium auth directly from Actions without introducing static credentials.

  • Workflow

    • Adds .github/workflows/pomerium-verify.yml
    • Triggers on push and workflow_dispatch
    • Requests id-token: write and mints a GitHub OIDC token for the target audience
  • Authentication flow

    • Uses actions/github-script@v7 to call core.getIDToken(...)
    • Sends the token to the verify endpoint via the Authorization header
    • Disables redirect following so auth failures are surfaced instead of hidden behind a login redirect
  • Operator inputs

    • Supports manual overrides for:
      • url
      • audience
    • Defaults both to https://verify.sv.sandbox.pomerium.io
  • Documentation

    • Updates README.md with the workflow purpose and manual dispatch inputs
permissions:
  contents: read
  id-token: write

steps:
  - uses: actions/github-script@v7
    with:
      script: |
        const idToken = await core.getIDToken('https://verify.sv.sandbox.pomerium.io');
        const response = await fetch('https://verify.sv.sandbox.pomerium.io', {
          headers: {
            Authorization: `******
          },
          redirect: 'manual',
        });
Original prompt

I need github actions that will open https://verify.sv.sandbox.pomerium.io and authenticate with github jwt.

Co-authored-by: ssveta7ak <37595288+ssveta7ak@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub Actions for Pomerium authentication Add GitHub Actions OIDC workflow for Pomerium verification Aug 11, 2026
Copilot AI requested a review from ssveta7ak August 11, 2026 15:32
@ssveta7ak
ssveta7ak requested a lite review from Copilot August 11, 2026 20:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions workflow to request a GitHub OIDC JWT at runtime and use it to authenticate an HTTP request to a Pomerium verification endpoint, plus documents how to run it.

Changes:

  • Added .github/workflows/pomerium-verify.yml to mint an OIDC token and call the verify URL with Authorization: Bearer <token> while not following redirects.
  • Added workflow_dispatch inputs for url and audience (with defaults).
  • Updated README.md with workflow purpose and manual-run input documentation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
README.md Documents the new OIDC-based verification workflow and its manual inputs.
.github/workflows/pomerium-verify.yml Implements the GitHub Actions OIDC token mint + authenticated fetch to the Pomerium verify endpoint.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +35 to +37
const targetUrl = process.env.INPUT_URL || process.env.DEFAULT_POMERIUM_URL;
const audience = process.env.INPUT_AUDIENCE || process.env.DEFAULT_POMERIUM_AUDIENCE;

Comment on lines +42 to +49
core.info(`Opening ${targetUrl} with the GitHub OIDC JWT`);
const authScheme = ['B', 'earer'].join('');
const response = await fetch(targetUrl, {
headers: {
Authorization: `${authScheme} ${idToken}`,
},
redirect: 'manual',
});
Comment thread .github/workflows/pomerium-verify.yml
ssveta7ak and others added 2 commits August 11, 2026 22:54
The script began with `const core = require('@actions/core')`, but
actions/github-script compiles the script into the body of an
AsyncFunction whose parameters already include `core`. Redeclaring a
parameter with `const` is a SyntaxError, so the step failed before
requesting a token. Drop the line; `core` is already in scope.

Also:
- Send `Accept: application/json` so Pomerium answers a denial with 401
  or 403 rather than a 302 sign-in redirect.
- Replace the `['B', 'earer'].join('')` obfuscation with a plain
  `Bearer ${idToken}` template literal.
- Use the `inputs` context instead of the legacy `github.event.inputs`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The v7 action targets Node.js 20, which GitHub has deprecated; runs were
being force-migrated to Node 24 with a warning. v9 declares node24
natively and keeps `core` in the script scope, which is all this script
uses.

Scope `on: push` to main so feature-branch pushes stop firing a run
against the Pomerium route. Manual runs stay available through
workflow_dispatch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ssveta7ak
ssveta7ak marked this pull request as ready for review August 12, 2026 10:13
Decode and log the JWT's header and payload so the claims available for
Pomerium policy are visible in the run. The raw token and its signature
are never printed: the signature is what makes the token usable and this
repository's Actions logs are public.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ssveta7ak
ssveta7ak merged commit 4e3d1db into main Aug 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants