22
33# Repasar
44
5- The Repasar GitHub Action (GHA) checks the current SHA that triggered the GHA
6- and check to make sure that it is signed properly using subcommands supported by
7- Git.
5+ The Repasar GitHub Action (GHA) checks the commit signatures for security. It
6+ now supports verifying ** all commits in a pull request (PR)** , not just the
7+ latest commit. For push events, it continues to verify the latest commit as
8+ before.
9+
10+ - For PRs: All commits in the PR are checked for verified signatures.
11+ - For pushes: Only the latest commit is checked.
812
913## Setup
1014
@@ -25,11 +29,12 @@ jobs:
2529 - name: Checkout the code
2630 uses: actions/checkout@v3
2731 - name: Run repasar on the latest SHA
28- uses: rogeruiz/repasar@v1.0 .0
32+ uses: rogeruiz/repasar@v1.1 .0
2933 with:
3034 allowed-signers-file-path: ./.github/allowed_signers
3135 fail-on-unverified: true
3236```
37+
3338## Required inputs
3439
3540The only required input is the ` allowed-signers-file-path ` which is recommended
@@ -40,19 +45,24 @@ keys in the following format per-line.
4045< email> [,< email> ...] < key type> < public key>
4146```
4247
43- These public keys are safe to check into your repository. To generate this file
44- based on the public keys available on GitHub for committers to the repository,
45- you can generate them using the ` allowedSignersFile ` project by @frankywahl .
46- This file can also be maintained manually and checked in by each individual
47- committer for your projects.
48-
49- [ => frankywahl/allowedSignersFile project] ( https://github.com/frankywahl/allowedSignersFile )
48+ > [ !IMPORTANT]
49+ > This file can be created manually by taking the public key file you have
50+ > locally and rearranging the comment email at the end to the beginning.
51+ > Remember to add only the emails you'd like to allow for verification purposes.
5052
5153## Optional inputs
5254
5355By default, this Action does not fail the run if the verification of the commit
54- is unsuccessful. If you would like to have the Action fail, then set the ` fail-on-unverified ` to ` true ` in the ` workflows/ ` YAML file.
56+ is unsuccessful. If you would like to have the Action fail, then set the
57+ ` fail-on-unverified ` to ` true ` in the ` workflows/ ` Yaml file.
5558
5659## Environment variables the action uses
5760
58- This action uses the ` ${GITHUB_SHA} ` variable to pull the current commit.
61+ - ` ${GITHUB_SHA} ` : Used for single commit verification (push events).
62+ - ` ${GITHUB_EVENT_NAME} ` and ` ${GITHUB_EVENT_PATH} ` : Used to detect PR context
63+ and extract PR number.
64+ - ` ${GITHUB_TOKEN} ` : ** Required for PR verification** to fetch all commits in
65+ the PR using the GitHub API.
66+
67+ ** Note:** For PRs, ensure the workflow has access to ` GITHUB_TOKEN ` (default in
68+ GitHub Actions) and that the token has ` repo ` scope for private repositories.
0 commit comments