Skip to content

Commit f2dd366

Browse files
github-actions[bot]actions-userSamuelOuvrard
authored
Version bump to v0.2.7 (#73)
* Bump version to v0.2.7 * added a check in version bump action to remove invocation loop * change version-bump action to check PR title instead of commit && include info about version bump and autosync for transfer-server in contributing.md --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Samuel Ouvrard <samuelroyouvrard@gmail.com>
1 parent 303f558 commit f2dd366

File tree

3 files changed

+60
-10
lines changed

3 files changed

+60
-10
lines changed

.github/workflows/version-bump.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,43 @@ jobs:
1313
token: ${{ secrets.GITHUB_TOKEN }}
1414
fetch-depth: 0
1515

16-
- name: Get latest commit message
17-
id: commit
18-
run: echo "message=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
16+
- name: Get PR title
17+
id: pr-title
18+
env:
19+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
run: |
21+
pr_number=$(git log -1 --pretty=%s | grep -o '#[0-9]\+' | sed 's/#//')
22+
if [ -n "$pr_number" ]; then
23+
pr_title=$(gh pr view $pr_number --json title --jq '.title')
24+
echo "title=$pr_title" >> $GITHUB_OUTPUT
25+
else
26+
echo "title=$(git log -1 --pretty=%B)" >> $GITHUB_OUTPUT
27+
fi
28+
29+
- name: Check if commit is a version bump
30+
id: skip-check
31+
run: |
32+
if [[ "${{ steps.pr-title.outputs.title }}" == "Version bump to"* ]]; then
33+
echo "skip=true" >> $GITHUB_OUTPUT
34+
echo "Skipping version bump workflow - commit is already a version bump"
35+
else
36+
echo "skip=false" >> $GITHUB_OUTPUT
37+
fi
1938
2039
- name: Determine version bump type
40+
if: steps.skip-check.outputs.skip == 'false'
2141
id: bump-type
2242
run: |
23-
if [[ "${{ steps.commit.outputs.message }}" == *"[Major Release]"* ]]; then
43+
if [[ "${{ steps.pr-title.outputs.title }}" == *"[Major Release]"* ]]; then
2444
echo "type=major" >> $GITHUB_OUTPUT
25-
elif [[ "${{ steps.commit.outputs.message }}" == *"[Minor Release]"* ]]; then
45+
elif [[ "${{ steps.pr-title.outputs.title }}" == *"[Minor Release]"* ]]; then
2646
echo "type=minor" >> $GITHUB_OUTPUT
2747
else
2848
echo "type=patch" >> $GITHUB_OUTPUT
2949
fi
3050
3151
- name: Calculate new version
52+
if: steps.skip-check.outputs.skip == 'false'
3253
id: version
3354
run: |
3455
if [ ! -f VERSION ]; then
@@ -59,6 +80,7 @@ jobs:
5980
echo "new_version=$new_version" >> $GITHUB_OUTPUT
6081
6182
- name: Check for existing version bump PR
83+
if: steps.skip-check.outputs.skip == 'false'
6284
id: check-pr
6385
env:
6486
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -73,7 +95,7 @@ jobs:
7395
fi
7496
7597
- name: Update existing PR
76-
if: steps.check-pr.outputs.exists == 'true'
98+
if: steps.skip-check.outputs.skip == 'false' && steps.check-pr.outputs.exists == 'true'
7799
env:
78100
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79101
run: |
@@ -89,7 +111,7 @@ jobs:
89111
gh pr edit "${{ steps.check-pr.outputs.number }}" --title "Version bump to ${{ steps.version.outputs.new_version }}"
90112
91113
- name: Create new PR
92-
if: steps.check-pr.outputs.exists == 'false'
114+
if: steps.skip-check.outputs.skip == 'false' && steps.check-pr.outputs.exists == 'false'
93115
env:
94116
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95117
run: |

CONTRIBUTING.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,39 @@ For best practices and information on developing with Terraform, see the [I&A Mo
1010

1111
In order to contibute code to this repository, you must submit a *[Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)*. To do so, you must *[fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo)* this repostiory, make your changes in your forked version and submit a *Pull Request*.
1212

13+
### Version Bump Automation
14+
15+
This repository uses automated version bumping based on PR titles. When your PR is merged to main, the version bump action will automatically create a new version based on your **PR title**:
16+
17+
- **Patch version** (default): Regular PRs will increment the patch version (e.g., v0.2.6 → v0.2.7)
18+
- **Minor version**: Include `[Minor Release]` at the beginning of your PR title to increment the minor version (e.g., v0.2.6 → v0.3.0)
19+
- **Major version**: Include `[Major Release]` at the beginning of your PR title to increment the major version (e.g., v0.2.6 → v1.0.0)
20+
21+
**Examples:**
22+
- `Add new SFTP connector feature` → Patch version bump
23+
- `[Minor Release] Add new SFTP connector feature` → Minor version bump
24+
- `[Major Release] Redesign transfer server architecture` → Major version bump
25+
26+
### Transfer Server Module Synchronization
27+
28+
> :warning: **IMPORTANT**: Do not modify files directly in the `modules/transfer-server/` directory.
29+
30+
The transfer-server module is automatically synchronized from the root module files. When you create or update a PR that modifies any of the following root files:
31+
32+
- `main.tf`
33+
- `outputs.tf`
34+
- `variables.tf`
35+
- `versions.tf`
36+
37+
The GitHub Action will automatically copy these files to `modules/transfer-server/` and update the module documentation. **Any changes made directly to files in `modules/transfer-server/` will be overwritten** during this synchronization process.
38+
39+
Always make your changes to the root module files, not the sub-module files.
40+
1341
## Writing Documentation
1442

15-
> :bangbang: **Do not manually update README.md**.
43+
> :bangbang: **Do not manually update README.md files**.
1644
17-
README.md is automatically generated by pulling in content from other files. For instructions, including a fill-in-the-blank content template, see [Create readmes for Terraform-based Partner Solutions.](https://aws-ia-us-west-2.s3.us-west-2.amazonaws.com/docs/content/index.html#/lessons/8rpYWWL59M7dcS-NsjYmaISUu-L_UqEv)
45+
README.md files are automatically generated by pulling in content from other files and using terraform-docs. For instructions, including a fill-in-the-blank content template, see [Create readmes for Terraform-based Partner Solutions.](https://aws-ia-us-west-2.s3.us-west-2.amazonaws.com/docs/content/index.html#/lessons/8rpYWWL59M7dcS-NsjYmaISUu-L_UqEv)
1846

1947
## Checks and Validation
2048

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.2.6
1+
v0.2.7

0 commit comments

Comments
 (0)