Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/padupe/action-content-change-validation
Action to validate if the content of a file (or directory) has changed.
https://github.com/padupe/action-content-change-validation
content-security-policy github-actions security-automation validation
Last synced: 23 days ago
JSON representation
Action to validate if the content of a file (or directory) has changed.
- Host: GitHub
- URL: https://github.com/padupe/action-content-change-validation
- Owner: padupe
- Created: 2023-04-13T17:52:41.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-05-15T16:12:12.000Z (over 1 year ago)
- Last Synced: 2024-09-29T23:41:06.255Z (about 1 month ago)
- Topics: content-security-policy, github-actions, security-automation, validation
- Language: TypeScript
- Homepage:
- Size: 792 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# action-content-change-validation
> Documentation available in Portuguese (pt-BR) [here](./docs/README-pt.md).
## Index
- [Description](#description)
- [Flow](#flow)
- [Requirements](#requirements)
- [GitHub App](#github-app)
- [Required Permissions](#required-permissions)
- [Secrets](#secrets)
- [Personal Access Token (PAT)](#personal-access-token-pat)
- [Required Permissions](#required-permissions-1)
- [Use](#use)
- [GitHub App](#github-app-1)
- [Personal Access Token (PAT)](#personal-access-token-pat-1)
- [Output](#output)
- [Contribute to the Project](#contribute-to-the-project)## Description
Action to validate if the content of a file (or directory) has changed.
Useful for ensuring that quality and/or safety processes are not accidentally - or not - changed by developers.
## Flow
![](./docs/assets/flow.png)
## Requirements
### [GitHub App](https://docs.github.com/en/apps)
#### Required Permissions:
- Repository
- Actions [Read and write]
- Commit status [Read and write]
- Contents [Read and write]
- Pull requests [Read and write]#### Secrets
Secret `CREDENTIALS_GITHUB_APP_PRIVATE_KEY` on PEM format:
```
-----BEGIN RSA PRIVATE KEY-----
9999999999999999999999999999999999999999999999999999999999999999
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
....
-----END RSA PRIVATE KEY-----
```### Personal Access Token (PAT)
#### Required Permissions
- Repo (Full control of private repositories)
## Use
### GitHub App
1. Create directory `.github/worfklows` in the root of your project;
2. Create file `content-change-validation.yaml` with content similar to the following:
```yaml
name: Content Change Validation
on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- mainjobs:
content-change-validation:
runs-on: ubuntu-latest
steps:
- name: Generate Token from GitHub App
id: generate-token-github-app
uses: padupe/[email protected]
with:
appId: ${{ secrets.CREDENTIALS_GITHUB_APP_ID }}
installationId: ${{ secrets.CREDENTIALS_GITHUB_APP_INSTALLATION_ID }}
privateKey: ${{ secrets.CREDENTIALS_GITHUB_APP_PRIVATE_KEY }}- name: Content Change Validation
uses: padupe/[email protected]
with:
directoryOrFile: .github/workflows
gitHubToken: ${{ steps.generate-token-github-app.outputs.gitHubToken }}
```### Personal Access Token (PAT)
1. Create directory `.github/worfklows` in the root of your project;
2. Create file `content-change-validation.yaml` with content similar to the following:
```yaml
name: Content Change Validation
on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- mainjobs:
content-change-validation:
runs-on: ubuntu-latest
steps:
- name: Content Change Validation
uses: padupe/[email protected]
with:
directoryOrFile: .github/workflows
gitHubToken: ${{ secrets.PAT_TOKEN }}
```## Output
Boolean value.
## Contribute to the Project
Check our [CONTRIBUTING](./CONTRIBUTING.md) guidelines.