Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: changelog action & example #408

Merged
merged 30 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
147360e
add changelog action & example
klmcadams Feb 22, 2024
4abbef2
add more comments
klmcadams Feb 22, 2024
310a350
Merge branch 'main' into feat/changelog-action
RobPasMue Feb 23, 2024
c963e03
Merge branch 'main' into feat/changelog-action
klmcadams Feb 26, 2024
3a9d1ef
add permissions & comments
klmcadams Feb 26, 2024
0f80490
change contents to write
klmcadams Feb 26, 2024
82e1ec7
change bot commit message
klmcadams Feb 26, 2024
078154a
update migration steps doc
klmcadams Feb 26, 2024
d1614ca
update migration guide and add ci bot creds
klmcadams Feb 27, 2024
f64d453
change yml to yaml
klmcadams Feb 27, 2024
bd0820c
remove ci bot from action
klmcadams Feb 27, 2024
8a73116
add token to checkout step & update docs
klmcadams Feb 27, 2024
ae6a088
change username to pyansys-ci-bot
klmcadams Feb 27, 2024
101b7c9
Merge branch 'main' into feat/changelog-action
RobPasMue Feb 28, 2024
4ce4f73
Merge branch 'main' into feat/changelog-action
klmcadams Feb 28, 2024
26751e7
created separate doc for changelog setup instructions linked in migra…
klmcadams Feb 28, 2024
bdf9d61
Merge branch 'feat/changelog-action' of https://github.com/ansys/acti…
klmcadams Feb 28, 2024
6365f8e
fix vale issues
klmcadams Feb 28, 2024
7293c59
add license headers :p
klmcadams Feb 28, 2024
0ad3ac5
fix token & indents in doc changelog setup
klmcadams Feb 28, 2024
58b6cea
use pyansys-geometry as example & change branch ref to main
klmcadams Feb 28, 2024
911e151
fix wording
klmcadams Feb 28, 2024
6eb7561
fix url in towncrier line for changelog
klmcadams Feb 28, 2024
390dcca
remove emphasis from towncrier
klmcadams Feb 28, 2024
1f30568
docs: layout
RobPasMue Feb 29, 2024
158c7d8
apply Kathy's changes
klmcadams Mar 12, 2024
a3831ce
remove capital towncrier
klmcadams Mar 12, 2024
a66c1b4
Merge branch 'main' into feat/changelog-action
klmcadams Mar 12, 2024
6bacbd4
fix indent warning
klmcadams Mar 12, 2024
e9a569b
Merge branch 'feat/changelog-action' of https://github.com/ansys/acti…
klmcadams Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc-changelog/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ inputs:

token:
description: >
GitHub token for doing a git commit & push
permissions:
contents: write
pull-requests: write
GitHub token for doing a git commit & push.
The "contents: write" and "pull-requests: write" permissions
are required for this action.
required: true
type: string

Expand Down Expand Up @@ -136,6 +135,7 @@ runs:
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
PR_TITLE: "${{ github.event.pull_request.title }}"
PR_NUMBER: ${{ github.event.number }}
GH_TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
RobPasMue marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
run: |
# Changelog fragment file in the following format
Expand Down
26 changes: 14 additions & 12 deletions doc/source/migration_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from one version of the actions to another, and other upstream dependencies that
have been updated.

Development version

Check warning on line 10 in doc/source/migration_guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/migration_guide.rst#L10

[Google.Headings] 'Development version' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Development version' should use sentence-style capitalization.", "location": {"path": "doc/source/migration_guide.rst", "range": {"start": {"line": 10, "column": 1}}}, "severity": "WARNING"}
-------------------

**New features:**
Expand All @@ -15,18 +15,20 @@
- Obscuring vulnerabilities results in ``ansys/actions/check-vulnerabilities``. This is useful when you want to hide the
vulnerabilities from the logs, but still want to fail the action if vulnerabilities are found.
- Avoid creating issues by default if vulnerabilities are found in ``ansys/actions/check-vulnerabilities``.
- Create a changelog file for each pull request using towncrier in ``ansys/actions/doc-changelog``.
- Create a changelog fragment file for each pull request using ``towncrier`` in ``ansys/actions/doc-changelog``.

**Breaking Changes:**

- N/A

**Migration Steps:**

- To set up your repository to use ``ansys/actions/doc-changelog``, follow these steps:
- To set up your repository to use ``ansys/actions/doc-changelog``, see the
`changelog implementation in PyMechanical <https://github.com/ansys/pymechanical/pull/617>`_
or follow these steps:

1. Add the following lines to the pyproject.toml file,
replacing {repo-name} with the name of the repository. For example, pymechanical.
replacing {repo-name} with the name of the repository. For example, ``pymechanical``.

.. code:: python

Expand Down Expand Up @@ -65,7 +67,7 @@
showcontent = true

2. Create the changelog.d folder in the root of your repository, and create a file named changelog_template.jinja.
Add the following lines to the jinja file:
Add the following lines to the ``jinja`` file:

.. code:: jinja

Expand Down Expand Up @@ -96,7 +98,7 @@
.. note::

If CHANGELOG.md already has sections for previous releases, make sure to put the
"towncrier release notes start" comment above the release sections. For example:
``"towncrier release notes start"`` comment above the release sections. For example:

Check warning on line 101 in doc/source/migration_guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/migration_guide.rst#L101

[Google.WordList] Use 'preceding' instead of 'above'.
Raw output
{"message": "[Google.WordList] Use 'preceding' instead of 'above'.", "location": {"path": "doc/source/migration_guide.rst", "range": {"start": {"line": 101, "column": 51}}}, "severity": "WARNING"}

.. code:: md

Expand All @@ -105,9 +107,9 @@
## [0.10.7](https://github.com/ansys/pymechanical/releases/tag/v0.10.7) - February 13 2024


4. Update .github/workflows/label.yml and .github/workflows/ci_cd.yml to use the changelog action.
4. Update ``.github/workflows/label.yml`` and ``.github/workflows/ci_cd.yml`` to use the changelog action.

Change the pull_request trigger at the top of each yml file above, so it lists the pull request actions that cause the workflows to run.
Change the ``pull_request`` trigger at the top of each ``.yml`` file above, so it lists the pull request actions that cause the workflows to run.

Check warning on line 112 in doc/source/migration_guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/migration_guide.rst#L112

[Google.WordList] Use 'preceding' instead of 'above'.
Raw output
{"message": "[Google.WordList] Use 'preceding' instead of 'above'.", "location": {"path": "doc/source/migration_guide.rst", "range": {"start": {"line": 112, "column": 74}}}, "severity": "WARNING"}

.. code:: yml

Expand All @@ -118,7 +120,7 @@
# labeled - when labels are added to PR
types: [opened, reopened, synchronize, edited, labeled]

At the bottom of .github/workflows/label.yml, add the following lines for the changelog action:
At the bottom of ``.github/workflows/label.yml``, add the following lines for the changelog action:

.. code:: yml

Expand All @@ -144,10 +146,10 @@

.. note::

"Added a feature!" will be the content of the file named 1.added.md.
The number one in "1.added.md" is the pull request number and "added" is the section the
content of the file will go under. For example, CHANGELOG.md would look like this if
the above md file only existed in changelog.d:
"Added a feature!" adds the content of the file named 1.added.md.
The number one in "1.added.md" is the pull request number and "added" is a subsection
under the released version. For example, ``CHANGELOG.md`` would look like this if
the above ``.md`` file only existed in changelog.d:

Check warning on line 152 in doc/source/migration_guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/migration_guide.rst#L152

[Google.WordList] Use 'preceding' instead of 'above'.
Raw output
{"message": "[Google.WordList] Use 'preceding' instead of 'above'.", "location": {"path": "doc/source/migration_guide.rst", "range": {"start": {"line": 152, "column": 11}}}, "severity": "WARNING"}

.. code:: md

Expand Down Expand Up @@ -186,7 +188,7 @@
**New features:**

- Added ``ansys/action/check-vulnerabilities`` to check for third party and first party vulnerabilities.
This action uses ``bandit`` and ``safety`` to check for vulnerabilities in the code and dependencies, respectively.

Check warning on line 191 in doc/source/migration_guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/migration_guide.rst#L191

[Google.WordList] Use 'select' instead of 'check'.
Raw output
{"message": "[Google.WordList] Use 'select' instead of 'check'.", "location": {"path": "doc/source/migration_guide.rst", "range": {"start": {"line": 191, "column": 49}}}, "severity": "WARNING"}
- Added ``ansys/actions/docker-style`` to check for Dockerfile style issues using ``hadolint``.
- Allow ``vale`` version input in ``ansys/actions/doc-style`` action. By default, ``2.29.6`` is used.
- Allow using the twine ``--skip-existing`` flag in the ``ansys/actions/release-pypi-*`` actions.
Expand Down