Skip to content

Commit

Permalink
fix: Removed duplicate step ID from _reusable-package-testpypi.yml (#23)
Browse files Browse the repository at this point in the history
* fix: Removed duplicate step ID from _reusable-package-testpypi.yml.

Also added a pre-commit hook to check the workflow files.

* fix: Fix issues found by actionlint in workflows

* ci: Skip running docker hooks in pre-commit.ci since it isn't available
  • Loading branch information
nfelt14 authored Aug 28, 2024
1 parent f7dc8db commit 5869bb6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: |
echo "## Breaking API Changes" > breaking_changes.md
echo "\`\`\`" >> breaking_changes.md
griffe check --format=verbose --against=$(git rev-parse origin/main) --search=src "$PACKAGE_NAME" 2>&1 | tee -a breaking_changes.md
griffe check --format=verbose --against="$(git rev-parse origin/main)" --search=src "$PACKAGE_NAME" 2>&1 | tee -a breaking_changes.md
- name: Finish writing summary file
run: echo "\`\`\`" >> breaking_changes.md
- uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_reusable-package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: python-versions-array input missing
if: ${{ inputs.build-and-publish-python-package == true && (inputs.python-versions-array == null || inputs.python-versions-array == '') }}
run: |
echo "The `python-versions-array` input is required when `build-and-publish-python-package` is set to `true`."
echo "The python-versions-array input is required when the build-and-publish-python-package input is set to true."
exit 1
- if: ${{ endsWith(github.repository, '/python-package-ci-cd') }} # Run the local action when this is run in the python-package-ci-cd repository
uses: ./actions/find_unreleased_changelog_items
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/_reusable-package-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- if: ${{ endsWith(github.repository, '/python-package-ci-cd') }} # Run the local action when this is run in the python-package-ci-cd repository
uses: ./actions/create_unique_testpypi_version
id: create-version
with:
package-name: ${{ inputs.package-name }}
- if: ${{ !endsWith(github.repository, '/python-package-ci-cd') }} # Run the public action when this is run outside the python-package-ci-cd repository
uses: tektronix/python-package-ci-cd/actions/[email protected]
- uses: tektronix/python-package-ci-cd/actions/[email protected]
id: create-version
with:
package-name: ${{ inputs.package-name }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/_reusable-publish-api-comparison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
path: artifacts
- name: Check for breaking changes
run: |
if grep -Pzl '\n```\n```' artifacts/breaking_changes.md; then
echo "BREAKING_CHANGES=false" >> $GITHUB_ENV
if grep -Pzl "\n\`\`\`\n\`\`\`" artifacts/breaking_changes.md; then
echo "BREAKING_CHANGES=false" >> "$GITHUB_ENV"
else
echo "BREAKING_CHANGES=true" >> $GITHUB_ENV
echo "BREAKING_CHANGES=true" >> "$GITHUB_ENV"
fi
- name: Fetch PR number
id: pr
Expand Down
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ default_stages: [pre-commit]
ci:
autofix_prs: false
autoupdate_schedule: quarterly
skip: [check-poetry, pyright, poetry-audit, markdown-link-check]
skip:
- check-poetry
- pyright
- poetry-audit
- markdown-link-check
- actionlint-docker
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # frozen: v4.6.0
Expand Down Expand Up @@ -38,6 +43,10 @@ repos:
- id: check-github-workflows
args: [--verbose]
files: ^(\.github/workflows/[^/]+|workflows/[^/]+)$
- repo: https://github.com/rhysd/actionlint
rev: v1.7.1
hooks:
- id: actionlint-docker
- repo: https://github.com/commitizen-tools/commitizen
rev: d7e01aa9b0cfe3c1b732e66d523bbd0656221127 # frozen: v3.29.0
hooks:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Valid subsections within a version are:

Things to be included in the next release go here.

### Fixed

- Fixed the `_reusable-package-testpypi.yml` workflow by removing a duplicate step ID that caused the workflow to be unusable

---

## v1.0.2 (2024-08-27)
Expand Down

0 comments on commit 5869bb6

Please sign in to comment.