diff --git a/.github/workflows/polish-the-code.yml b/.github/workflows/polish-the-code.yml index 54518ef..7709d14 100644 --- a/.github/workflows/polish-the-code.yml +++ b/.github/workflows/polish-the-code.yml @@ -20,7 +20,34 @@ permissions: contents: read jobs: + commit-check: + runs-on: ubuntu-latest + # use permissions because pull-request comments are used + permissions: + contents: read + pull-requests: write + # Limit the running time + timeout-minutes: 10 + steps: + - uses: actions/checkout@v5 + with: + ref: ${{ github.event.pull_request.head.sha }} # checkout PR HEAD commit + fetch-depth: 0 # required for merge-base check + persist-credentials: false + - uses: commit-check/commit-check-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # use GITHUB_TOKEN because use of pr-comments + with: + message: true + # to accept dependabot/github_actions/* + # branch: false # todo might not be necessary as "dependabot[bot]" author is ignored + author-name: true + author-email: true + job-summary: true + pr-comments: ${{ github.event_name == 'pull_request' }} + super-linter: - uses: WorkOfStan/seablast-actions/.github/workflows/linter.yml@v0.2.5.1 + needs: commit-check + uses: WorkOfStan/seablast-actions/.github/workflows/linter.yml@v0.2.7 with: runs-on: "ubuntu-latest" diff --git a/.github/workflows/prettier-fix.yml b/.github/workflows/prettier-fix.yml index 940c098..08706a5 100644 --- a/.github/workflows/prettier-fix.yml +++ b/.github/workflows/prettier-fix.yml @@ -22,8 +22,8 @@ jobs: timeout-minutes: 10 steps: - name: Invoke the Prettier fix - # Use the latest commit in the main branch. - uses: WorkOfStan/prettier-fix@main + # Use the latest minor version within the current major version. + uses: WorkOfStan/prettier-fix@v1 with: commit-changes: true #debug: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 75d055d..c9187b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Security` in case of vulnerabilities +## [1.1.6.2] - 2025-10-23 + +chore: make the commit message compliant with Conventional Commits + +### Changed + +- make the commit message compliant with Conventional Commits +- Bump [actions/setup-node](https://github.com/actions/setup-node) from 4 to 6. + - [Release notes](https://github.com/actions/setup-node/releases) + - [Commits](https://github.com/actions/setup-node/compare/v4...v6) + ## [1.1.6.1] - 2025-09-13 fix: Tags MUST NOT trigger the GitHub Action. @@ -123,7 +134,8 @@ fix: pull request issues - This GitHub Action automates Prettier formatting across your project, ensuring consistent code styling by creating a new branch for review when necessary. It simplifies integrating Prettier into your workflow, although updates to workflow YAML files in `.github/workflows/` must be done manually. -[Unreleased]: https://github.com/WorkOfStan/prettier-fix/compare/v1.1.6.1...HEAD +[Unreleased]: https://github.com/WorkOfStan/prettier-fix/compare/v1.1.6.2...HEAD +[1.1.6.2]: https://github.com/WorkOfStan/prettier-fix/compare/v1.1.6.1...v1.1.6.2?w=1 [1.1.6.1]: https://github.com/WorkOfStan/prettier-fix/compare/v1.1.6...v1.1.6.1?w=1 [1.1.6]: https://github.com/WorkOfStan/prettier-fix/compare/v1.1.5...v1.1.6?w=1 [1.1.5]: https://github.com/WorkOfStan/prettier-fix/compare/v1.1.4...v1.1.5?w=1 diff --git a/LICENSE b/LICENSE index 9dc72a3..56c5644 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 WorkOfStan +Copyright (c) 2024-2025 WorkOfStan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 6c5c427..c454093 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,14 @@ permissions: ### Inputs (all optional) -| Input | Description | Type | Default | -| ---------------------- | ------------------------------------------------------------------------------ | ------- | ---------------------------------------- | -| `commit-changes` | If `true`, commits changes to the current branch instead of creating a new one | Boolean | `false` | -| `commit-message` | Commit message for the changes | String | `"Prettier fixes applied automatically"` | -| `debug` | Enable extra debug output (list of branches). | Boolean | `false` | -| `node-version` | Node.js version to use | String | `"20"` | -| `prettier-config-path` | Optional path to a custom Prettier config file | String | `""` | -| `skip-package-setup` | If `true`, skips `npm init` and dependency installation steps | Boolean | `false` | +| Input | Description | Type | Default | +| ---------------------- | ------------------------------------------------------------------------------ | ------- | ------------------------------------------------------- | +| `commit-changes` | If `true`, commits changes to the current branch instead of creating a new one | Boolean | `false` | +| `commit-message` | Commit message for the changes | String | `"chore(prettier): apply Prettier fixes automatically"` | +| `debug` | Enable extra debug output (list of branches). | Boolean | `false` | +| `node-version` | Node.js version to use | String | `"20"` | +| `prettier-config-path` | Optional path to a custom Prettier config file | String | `""` | +| `skip-package-setup` | If `true`, skips `npm init` and dependency installation steps | Boolean | `false` | Note: it would be possible to use `git-user-name` and `git-user-email` as inputs to set-up the info about the author of the commits, but for clarity [actions/checkout](https://github.com/actions/checkout?tab=readme-ov-file#push-a-commit-using-the-built-in-token) recommends diff --git a/action.yml b/action.yml index 84f037f..1a6b5a3 100644 --- a/action.yml +++ b/action.yml @@ -19,7 +19,7 @@ inputs: commit-message: description: "Commit message for the changes" type: string - default: "chore: Prettier fixes applied automatically" + default: "chore(prettier): apply Prettier fixes automatically" debug: description: "Enable extra debug output" type: boolean @@ -47,6 +47,10 @@ outputs: runs: using: "composite" steps: + - name: Display version + run: echo "prettier-fix::v1.1.6.2 running" + shell: bash + - name: Checkout code uses: actions/checkout@v5 with: @@ -59,7 +63,7 @@ runs: shell: bash - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: ${{ inputs.node-version }}