Skip to content

Commit 42f1087

Browse files
authored
docs: update README and SECURITY for GITHUB_TOKEN usage (#18)
- Updated README.md to remove reference to custom PATs. - Clarified SECURITY.md with details on using the default GITHUB_TOKEN for scoped access, security, and simplified token management.
1 parent aa6fa34 commit 42f1087

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ requests and creating releases.
124124
for `pull-requests` must be set to `"write"`.
125125
- Additionally, the workflow permission for `contents` must also be set to `"write"` to allow the action to create tags
126126
and releases.
127-
- If you are using a Personal Access Token (PAT), ensure that it has the `repo` scope granted. This permission is
128-
required for the action to read and write to the repository, including managing pull requests and creating releases.
127+
- For security considerations and best practices when using the `github_token` or PATs, please refer to the
128+
[Security Documentation](./security.md).
129129
- Ensure the **Restrict editing to users in teams with push access only** setting is enabled for public repositories, as
130130
the GitHub Actions Bot can write to the wiki by default.
131131

@@ -209,3 +209,11 @@ by Piotr Krukowski.
209209
your workflow, this action will not be triggered. An alternative approach would be to split this action into two
210210
separate actions and workflows, one for pull requests and one for direct pushes to the main branch. However, this
211211
would require additional configuration and setup in the calling code.
212+
213+
## License
214+
215+
The scripts and documentation in this project are released under the [MIT License](./LICENSE.md).
216+
217+
## Security
218+
219+
For detailed information about security practices and guidelines, check out the [Security Documentation](./security.md).

SECURITY.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,32 @@ security risks, we recommend the following practices when using this Action:
3636
- **Audit GitHub Actions dependencies** regularly to ensure that no third-party actions have introduced vulnerabilities
3737
or insecure behaviors.
3838

39+
## Why This Action Uses the Default `GITHUB_TOKEN`
40+
41+
This action utilizes the default `GITHUB_TOKEN` for several important reasons, ensuring that it operates efficiently and
42+
securely:
43+
44+
1. **Scoped Access to the Current Repository**: The `GITHUB_TOKEN` is automatically generated by GitHub for every
45+
workflow run and is scoped to the repository in which the action is triggered. It provides the necessary permissions
46+
to interact with that specific repository, such as reading pull request data, interacting with GitHub APIs, and
47+
making commits. Since this action operates within the same repository, there’s no need for external authentication or
48+
elevated permissions, ensuring minimal access for optimal security.
49+
50+
1. **No Cross-Repository Access**: This action does not require access to other repositories. The default `GITHUB_TOKEN`
51+
is scoped only to the repository where the action is executed. This makes it unnecessary to configure additional
52+
tokens or credentials, keeping the action simple and secure.
53+
54+
1. **Security and Minimal Exposure**: The `GITHUB_TOKEN` is ephemeral—it is automatically revoked at the end of each
55+
workflow run and does not persist beyond the scope of the action. This limits its exposure and prevents any misuse
56+
beyond its intended purpose.
57+
58+
1. **Simpler Token Management**: Using the `GITHUB_TOKEN` eliminates the need for manually managing personal access
59+
tokens (PATs), which would require extra steps for setup, maintenance, and possible re-authentication. GitHub handles
60+
the lifecycle of this token automatically, reducing the risk of human error and making this action more secure.
61+
62+
By leveraging the default `GITHUB_TOKEN`, this action minimizes security risks, simplifies configuration, and ensures
63+
that it remains efficient and secure.
64+
3965
## Resources
4066

4167
- [GitHub Actions Security Best Practices](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions)

0 commit comments

Comments
 (0)