Skip to content

Commit 9b6273c

Browse files
committed
Fixed major parameter problem with action.yml.
1 parent 2617c6f commit 9b6273c

6 files changed

Lines changed: 36 additions & 14 deletions

File tree

.github/workflows/check-same-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
cache: 'pip' # optional
2727

2828
- name: Run same-version
29-
uses: willynilly/same-version@v1.0.0
29+
uses: willynilly/same-version@v2.0.0
3030
with:
3131
fail_for_missing_file: false
3232
check_github_event: true

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ keywords:
3232
- metadata
3333
- harmonization
3434
license: Apache-2.0
35-
version: "1.0.0"
35+
version: "2.0.0"
3636
date-released: "2025-06-10"
3737
references:
3838
- title: Citation File Format

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ These files are currently supported out-of-the-box:
100100
|-------------------------------|-----------------------------------------|--------------------|---------------------|-------------------|
101101
| `--base-version` | `base_version` | Base version from which to compare all other versions | No | *(empty)* |
102102
| `--check-github-event` | `check_github_event` | Check GitHut events? (`true` or `false`) | No | `false` |
103-
| `--github-event-name` | `github_event_name` | GitHub event name (`push` or `release`) | No | *(empty)* |
103+
| `--github-event-name` | `github_event_name` | GitHub event name (`push` or `release` or `pull_request`) | No | *(empty)* |
104104
| `--github-event-ref` | `github_event_ref` | GitHub ref (for `push` event) | No | *(empty)* |
105105
| `--github-event-release-tag` | `github_event_release_tag` | GitHub release tag name (for `release` event) | No | *(empty)* |
106106
| `--fail-for-missing-file` | `fail_for_missing_file` | Fail for any checked file that is missing| No | `false` |
@@ -170,7 +170,7 @@ jobs:
170170
cache: 'pip'
171171

172172
- name: Run same-version
173-
uses: willynilly/same-version@v1.0.0
173+
uses: willynilly/same-version@v2.0.0
174174
with:
175175
fail_for_missing_file: false
176176
check_github_event: true
@@ -220,7 +220,7 @@ jobs:
220220
cache: 'pip'
221221

222222
- name: Run same-version
223-
uses: willynilly/same-version@v1.0.0
223+
uses: willynilly/same-version@v2.0.0
224224
with:
225225
fail_for_missing_file: false
226226
check_github_event: true
@@ -257,7 +257,7 @@ Add to your `.pre-commit-config.yaml`:
257257
```yaml
258258
repos:
259259
- repo: https://github.com/willynilly/same-version
260-
rev: v1.0.0 # Use latest tag
260+
rev: v2.0.0 # Use latest tag
261261
hooks:
262262
- id: same-version
263263
```

action.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,23 @@ description: >
88
author: Will Riley <wanderingwill@gmail.com>
99

1010
inputs:
11+
fail_for_missing_file:
12+
description: 'Fail for any checked file that is missing'
13+
required: false
14+
default: 'false'
15+
check_github_event:
16+
description: 'check-github-event'
17+
required: false
18+
default: 'false'
1119
github_event_name:
12-
description: 'GitHub event name (push or release)'
13-
required: true
20+
description: 'GitHub event name (push, release, or pull_request event)'
21+
required: false
1422
github_event_ref:
1523
description: 'GitHub ref (for push event)'
1624
required: false
1725
github_event_release_tag:
1826
description: 'GitHub release tag name (for release event)'
1927
required: false
20-
fail_for_missing_file:
21-
description: 'Fail for any checked file that is missing'
22-
required: false
23-
default: 'false'
2428
check_citation_cff:
2529
description: 'Check `CITATION.cff`? (`true/false`)'
2630
required: false
@@ -80,5 +84,22 @@ runs:
8084

8185
- name: Run same-version
8286
id: check_same_version
83-
run: same-version --check-citation-cff "${{ inputs.check_citation_cff }}" --citation-cff-path "${{ inputs.citation_cff_path }}" --check-pyproject-toml "${{ inputs.check_pyproject_toml }}" --pyproject-toml-path "${{ inputs.pyproject_toml_path }}" --check-codemeta-json "${{ inputs.check_codemeta_json }}" --codemeta-json-path "${{ inputs.codemeta_json_path }}" --check-zenodo-json "${{ inputs.check_zenodo_json }}" --zenodo-json-path "${{ inputs.zenodo_json_path }}" --check-package-json "${{ inputs.check_package_json }}" --package-json-path "${{ inputs.package_json_path }}" --check-setup-py "${{ inputs.check_setup_py }}" --setup-py-path "${{ inputs.setup_py_path }}" --check-github-event "${{ inputs.check_github_event }}" --github-event-name "${{ inputs.event_name }}" --github-event-ref "${{ inputs.ref }}" --github-event-release-tag "${{ inputs.release_tag }}" --fail-for-missing-file "${{ inputs.fail_for_missing_file }}"
87+
run: same-version \
88+
--check-citation-cff "${{ inputs.check_citation_cff }}" \
89+
--citation-cff-path "${{ inputs.citation_cff_path }}" \
90+
--check-pyproject-toml "${{ inputs.check_pyproject_toml }}" \
91+
--pyproject-toml-path "${{ inputs.pyproject_toml_path }}" \
92+
--check-codemeta-json "${{ inputs.check_codemeta_json }}" \
93+
--codemeta-json-path "${{ inputs.codemeta_json_path }}" \
94+
--check-zenodo-json "${{ inputs.check_zenodo_json }}" \
95+
--zenodo-json-path "${{ inputs.zenodo_json_path }}" \
96+
--check-package-json "${{ inputs.check_package_json }}" \
97+
--package-json-path "${{ inputs.package_json_path }}" \
98+
--check-setup-py "${{ inputs.check_setup_py }}" \
99+
--setup-py-path "${{ inputs.setup_py_path }}" \
100+
--check-github-event "${{ inputs.check_github_event }}" \
101+
--github-event-name "${{ inputs.github_event_name }}" \
102+
--github-event-ref "${{ inputs.github_event_ref }}" \
103+
--github-event-release-tag "${{ inputs.github_event_release_tag }}" \
104+
--fail-for-missing-file "${{ inputs.fail_for_missing_file }}"
84105
shell: bash

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "same-version"
7-
version = "1.0.0"
7+
version = "2.0.0"
88
description = "Automatically ensures your software version metadata is consistent across key project files."
99
readme = "README.md"
1010
requires-python = ">=3.12"

src/same_version/extractors/github_event_extractor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def _get_version_from_data(self, data: dict) -> str | None:
5555
logger.info(f"📦 Detected GitHub release tag version: {version}")
5656
return version
5757
elif event_name == 'pull_request':
58+
logger.info("📦 Detected GitHub pull request")
5859
return None
5960
else:
6061
logger.error(f"❌ Unsupported GitHub event: {event_name}")

0 commit comments

Comments
 (0)