{"id":27657134,"url":"https://github.com/lullabot/terminus-auth-with-session-cache","last_synced_at":"2026-04-25T21:33:46.432Z","repository":{"id":191215841,"uuid":"684171763","full_name":"Lullabot/terminus-auth-with-session-cache","owner":"Lullabot","description":"A GitHub Action that either logs into Terminus via machine token or securely restores from a previously-authenticated Terminus session","archived":false,"fork":false,"pushed_at":"2024-03-06T19:27:24.000Z","size":20,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-24T06:54:47.977Z","etag":null,"topics":["auth0","concurr","ddev","drainpipe","github-action","github-actions","pantheon","parrallelism","rate-limiting","terminus"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lullabot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2023-08-28T15:48:22.000Z","updated_at":"2023-11-25T04:29:31.000Z","dependencies_parsed_at":"2024-03-06T20:55:17.312Z","dependency_job_id":null,"html_url":"https://github.com/Lullabot/terminus-auth-with-session-cache","commit_stats":null,"previous_names":["lullabot/terminus-auth-with-session-cache"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Lullabot/terminus-auth-with-session-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lullabot%2Fterminus-auth-with-session-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lullabot%2Fterminus-auth-with-session-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lullabot%2Fterminus-auth-with-session-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lullabot%2Fterminus-auth-with-session-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lullabot","download_url":"https://codeload.github.com/Lullabot/terminus-auth-with-session-cache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lullabot%2Fterminus-auth-with-session-cache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32278249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["auth0","concurr","ddev","drainpipe","github-action","github-actions","pantheon","parrallelism","rate-limiting","terminus"],"created_at":"2025-04-24T06:54:46.236Z","updated_at":"2026-04-25T21:33:46.415Z","avatar_url":"https://github.com/Lullabot.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Action for caching Terminus session\n\nCaching and reusing the authenticated Terminus session between jobs helps\nprevent login errors due to Auth0 rate limiting during parallel jobs all trying\nto authenticate at the same time.\n\n## DDEV\nIf you use [DDEV](https://ddev.com/) in GitHub Actions, you can pass \"`ddev:\ntrue`\" to authenticate Terminus inside the DDEV container instead of the host\n(GitHub Actions job runner). Before calling this action with \"`ddev: true`\",\ninstall and start DDEV with one of these actions:\n\n- Official: [Setup DDEV in Github Workflows](https://github.com/marketplace/actions/setup-ddev-in-github-workflows)\n- [Drainpipe](https://github.com/Lullabot/drainpipe)'s version has additional settings for configuring SSH keys, git user, and composer cache directory: [action.yml](https://github.com/Lullabot/drainpipe/blob/main/scaffold/github/actions/common/ddev/action.yml)\n\n## Example: Caching a session token before matrix'd jobs\nMake sure a Terminus session is stored in cache before attempting to run jobs in\nparallel. We can accomplish this by adding a \"needs\" dependency on a preliminary\njob that refreshes the Terminus session token:\n```yaml\nname: Example workflow demonstrating how to authenticate Terminus before\n  dispatching jobs in parallel\non:\n  push:\n    branches:\n      - 'main'\njobs:\n  TerminusGetSession:\n    runs-on: ubuntu-22.04\n    # Always store production secrets in a GitHub \"Environment\" that restricts\n    # which branches can deploy to it, and protect those branches with rules\n    # including code reviews and security tests.\n    # @see https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment\n    # environment: \u003cenvironment-name\u003e\n    environment: Pantheon\n    steps:\n      - name: Populate a new Terminus session in cache before dispatching the\n          matrix'd job\n        uses: lullabot/terminus-auth-with-session-cache@v2\n        with:\n          pantheon-machine-token: ${{ secrets.PANTHEON_MACHINE_TOKEN }}\n          # Note: DDEV is never needed for this step since we're just trying to\n          # generate and cache the session token for later jobs (which may use\n          # DDEV).\n          # ddev: false\n  ExampleParallelJob:\n    # This \"needs\" dependency makes sure the session is cached before starting\n    # these parallel jobs.\n    needs: [TerminusGetSession]\n    runs-on: ubuntu-22.04\n    environment: Pantheon\n    strategy:\n      matrix: ['site-a', 'site-b', 'site-c']\n    steps:\n      - name: Log in to Terminus by restoring existing session or initiating new\n        uses: lullabot/terminus-auth-with-session-cache@v2\n        with:\n          pantheon-machine-token: ${{ secrets.PANTHEON_MACHINE_TOKEN }}\n          # Set 'ddev: true' if using DDEV in GitHub Actions.\n          # ddev: true\n      - name: Example step, clear caches on each site\n        run: ddev terminus drush ${{ matrix.site-name }}.live -- cache:rebuild\n        shell: bash\n```\n\n## Example: Refresh Terminus sessions during off-peak hours\nIf you have many workflows running simultaneously, you may opt for generating\nnew Terminus sessions during off-peak hours, so an old session doesn't expire at\na random moment when concurrent jobs are running.\n```yaml\nname: Refresh 24h Dev and Prod Terminus sessions during off-peak hours\non:\n  schedule:\n    # 8am UTC is 3am US Central Time\n    - cron:  '0 8 * * *'\njobs:\n  TerminusGetDevSession:\n    runs-on: ubuntu-22.04\n    steps:\n      - name: Refresh the Development Terminus session in cache\n        uses: lullabot/terminus-auth-with-session-cache@v2\n        with:\n          # Development token secret may be repository-wide.\n          pantheon-machine-token: ${{ secrets.PANTHEON_MACHINE_TOKEN_DEV }}\n          # Tell the action to grab a fresh session and ignore any existing\n          # cache.\n          force-new-session: true\n  TerminusGetProdSession:\n    runs-on: ubuntu-22.04\n    # environment: \u003cenvironment-name\u003e\n    environment: Pantheon\n    steps:\n      - name: Refresh the Production Terminus session in cache\n        uses: lullabot/terminus-auth-with-session-cache@v2\n        with:\n          # Production token secret should be protected behind an Environment.\n          pantheon-machine-token: ${{ secrets.PANTHEON_MACHINE_TOKEN_PRODUCTION }}\n          # Tell the action to grab a fresh session and ignore any existing\n          # cache.\n          force-new-session: true\n```\n\n## Pantheon documentation\nThe related Pantheon documentation lives here: [Authenticate Terminus in a\nGitHub Actions Pipeline](https://docs.pantheon.io/terminus/ci/github-actions).\nIt currently recommends a different approach but hopefully will be updated soon\nto reference this action or an equivalent one.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flullabot%2Fterminus-auth-with-session-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flullabot%2Fterminus-auth-with-session-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flullabot%2Fterminus-auth-with-session-cache/lists"}