Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
#### Deprecated
#### Removed

## [1.2.0] - 2025-03-21

### Added

* feat: Add `ignore` input to the github action, enabling to ignore some files when checking the scaffold resources.

## [1.1.1] - 2025-02-20

### Fixed
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,28 @@ jobs:
uses: Telefonica/opensource-scaffold@v1
```

> [!TIP]
> You can ignore some files when checking the open source resources by providing a list of glob patterns in the `ignore` input. For example, if your repository is a monorepo and you want to ignore the root CHANGELOG.md file, you can omit it by adding `CHANGELOG.md` to the `ignore` input. Read the [inputs](#inputs) section for more information.

#### Inputs

The `opensource-scaffold` action supports the following inputs:

| Name | Description | Type | Required | Default |
| --- | --- | --- | --- | --- |
| `log` | The log level to use when running the action | String | No | `info` |
| `ignore` | A semicolon separated list of glob patterns to ignore files when checking the open source resources | String | No | - |

Example:

```yaml
- name: Check Open Source scaffold
uses: Telefonica/opensource-scaffold@v1
with:
log: debug
ignore: "CHANGELOG.md;**/ISSUE_TEMPLATE/**"
```

## The scaffold

Once you initialize an open source project using this scaffold, it will include the following:
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ inputs:
- 'silent'
default: 'info'
required: false
ignore:
description: 'List of glob patterns to ignore, semi-colon separated'
required: false
outputs:
valid:
description: 'Whether the check passed or not'
Expand Down
7 changes: 6 additions & 1 deletion action/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ function valueIfDefined<T = string>(value: T): T | undefined {
export async function run(): Promise<void> {
try {
const log = valueIfDefined((core.getInput("log") as LogLevel) || "");
const checker = new Checker({ log });
const ignore = valueIfDefined(core.getInput("ignore") || "");
const ignorePatterns = ignore
? ignore.split(";").map((ignorePattern) => ignorePattern.trim())
: undefined;

const checker = new Checker({ log, ignore: ignorePatterns });
const result = await checker.check();

core.setOutput("valid", result.valid.toString());
Expand Down
Loading