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
2 changes: 1 addition & 1 deletion .github/workflows/open-source-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
npm-token: ${{ secrets.NPM_TOKEN_XCUT }}

- name: Check License Compliance
uses: Telefonica/check-license-compliance/.github/actions/check-and-comment@v3.0.0-beta.2
uses: Telefonica/check-license-compliance/.github/actions/check-and-comment@v3.0.0-beta.3
with:
config-file: .github/check-license-compliance.config.yml
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-docs-to-confluence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- name: Sync Docs
id: sync-docs
uses: Telefonica/markdown-confluence-sync-action@v1
uses: Telefonica/markdown-confluence-sync-action@v2
with:
mode: id
docs-dir: '.'
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
#### Deprecated
#### Removed

## [1.2.0] - 2025-03-24

### Added

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

### Changed

* chore: Upgrade `check-license-compliance` to v3.0.0-beta.3 (Support more granularity for including or excluding modules)

## [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