{"id":16805265,"url":"https://github.com/joshjohanning/enforce-github-pat-expiration","last_synced_at":"2025-07-02T19:35:18.755Z","repository":{"id":191655998,"uuid":"685245601","full_name":"joshjohanning/enforce-github-pat-expiration","owner":"joshjohanning","description":"GitHub action to check to see if PATs are conforming to a specific expiration policy","archived":false,"fork":false,"pushed_at":"2024-02-21T19:45:57.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T20:35:56.426Z","etag":null,"topics":["actions","administration","automation","github","personal-access-tokens"],"latest_commit_sha":null,"homepage":"","language":null,"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/joshjohanning.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}},"created_at":"2023-08-30T20:18:48.000Z","updated_at":"2024-02-25T14:24:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2adc263-d95f-42b1-910f-77027e3d3d8d","html_url":"https://github.com/joshjohanning/enforce-github-pat-expiration","commit_stats":null,"previous_names":["joshjohanning/enforce-github-pat-expiration"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Fenforce-github-pat-expiration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Fenforce-github-pat-expiration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Fenforce-github-pat-expiration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshjohanning%2Fenforce-github-pat-expiration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshjohanning","download_url":"https://codeload.github.com/joshjohanning/enforce-github-pat-expiration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312061,"owners_count":20918344,"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":["actions","administration","automation","github","personal-access-tokens"],"created_at":"2024-10-13T09:47:39.421Z","updated_at":"2025-04-05T09:16:27.524Z","avatar_url":"https://github.com/joshjohanning.png","language":null,"readme":"# enforce-github-pat-expiration\n\nRevokes the SSO authorization for classic Personal Access Tokens (PATs) that don't meet the maximum expiration policy defined in the action (i.e.: those over 90 days or those with no expiration).\n\n\u003e [!IMPORTANT]\n\u003e This action will only work in organizations that have configured SAML SSO.\n\n\u003e [!IMPORTANT]\n\u003e This action only works with classic PATs.\n\n## Sample Usage\n\n```yml\nname: 🔎 Enforce PAT expiration policy\non:\n  schedule:\n    - cron: 0,30 * * * * # runs every 30 mins\n  workflow_dispatch:\n\njobs:\n  check-pats:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/create-github-app-token@v1\n      id: app-token\n      with:\n        app-id: ${{ vars.APP_ID }} # use an app with `organization: admin write` permissions\n        private-key: ${{ secrets.PRIVATE_KEY }}\n        owner: ${{ github.repository_owner }}\n    - name: Check and Revoke PATs\n      uses: joshjohanning/enforce-github-pat-expiration@v1\n      with:\n        organization: ${{ github.repository_owner }}\n        policy-in-days: 90\n        github-token: ${{ steps.app-token.outputs.token }} # use a PAT with `admin:org` permissions or a GitHub app token with org admin write permissions\n        dry-run: false # change to true to not revoke any PATs\n        create-issue: false # change to true to create an issue and assign to the user whose PAT is being revoked (can't be used with dry-run)\n        issue-repo: ${{ github.repository }} # if create-issue is true, repo to create the issue in\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshjohanning%2Fenforce-github-pat-expiration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshjohanning%2Fenforce-github-pat-expiration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshjohanning%2Fenforce-github-pat-expiration/lists"}