Skip to content

Commit

Permalink
chore: use dependabot for composite actions updates (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
nepalevov authored Oct 23, 2024
1 parent 585625d commit be3770d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 28 deletions.
7 changes: 6 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
directories:
- "/"
- "/actions/**"
schedule:
interval: "weekly"
day: "wednesday"
time: "09:00"
commit-message:
# Prefix all commit messages with "chore: "
prefix: "chore"
ignore:
- dependency-name: "epam/ai-dial-ci"
open-pull-requests-limit: 100
62 changes: 35 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,74 @@

Thank you for your interest in contributing to our project. The following is a set of guidelines for contributing to this project.

## Workflow
## Contributors Workflow

### 1. Installing pre-commit
### Configure pre-commit

We use pre-commit to ensure code quality. Please install it following the steps below:
We use pre-commit to ensure code quality. We kindly ask you to use it before creating a pull request.

Install pre-commit package globally:
1. Install pre-commit using pip (if you haven't already):

```bash
pip install pre-commit
```
```bash
pip install pre-commit
```

Then install the git hook scripts, run:
1. Then install the git hook scripts:

```bash
pre-commit install
```
```bash
pre-commit install
```

Pre-commit will now run on every commit. If you want to run pre-commit manually, you can use:
Pre-commit will now run on every commit. If you want to run pre-commit checks manually, you can use:

```bash
pre-commit run
```

### 2. Creating a Feature Branch
### Creating a Feature Branch

Before you start working, please create a new feature branch. This will ensure your ongoing work does not affect the main branch and makes it easier to merge your changes later.
Before you start working, please create a new, "feature" branch from the repo's default one. This will ensure your ongoing work does not affect the main branch and makes it easier to merge your changes later.
To create a new branch:
```bash
git checkout -b your-new-branch
```
**While doing changes, make sure to update self-dependencies in actions versions.**
### Creating a Pull Request (PR)
### 3. Creating a Pull Request (PR)
Once ready, you can create a PR back from your feature branch to a repo's default branch.

Once ready, you can create a PR. We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). Make sure to prefix the title with one of the following: `fix:`, `feat:`, `feature:`, `chore:`, `hotfix:`. Breaking change pull requests may include `!` after the type/scope, e.g. `<type>!: <description>`.
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). Make sure to prefix the title with one of the following: `fix:`, `feat:`, `feature:`, `chore:`, `hotfix:`. Breaking change pull requests may include `!` after the type/scope, e.g. `<type>!: <description>`.

This helps maintainers to categorize the PR and understand its purpose easier.
## Maintainers Workflow

### For Maintainers
### Checking a Pull Request (PR)

After a PR is created, it needs to be checked and reviewed before merging.

#### 1. Checking, Approving, and Merging with squash
Review the changes in the PR and ensure they adhere to the code quality standards and are aligned with the project's objectives.
### Updating Self-Dependencies
Once PR checked, ensure the self-dependencies (occurrences of `uses: epam/ai-dial-ci`) in it are updated. We don't update self-dependencies automatically, e.g. with Dependabot, so it must be done in the PR manually. You may use `update-self-dependencies.sh` script for your convenience.

```console
$ ./update-self-dependencies.sh
Enter the next (predicted) version tag (e.g., 1.0.1): 1.9.3
Updated all occurrences of 'epam/ai-dial-ci/' with version '1.9.3'.
$
```

Review the changes in the PR and ensure they adhere to the code quality standards and are aligned with the project's objectives. Once approved, merge the PR and squash the commits.
After updating self-dependencies, commit the changes and push them to the PR branch. Approve the PR and merge it.

#### 2. Creating a new release
### Creating a new release

Follow the steps below to create a new release on GitHub:

1. Navigate to your repository homepage.
1. Click on the "Releases" tab which is next to the "About" section on the right side of the page.
1. Click on "Draft a new release" button which is toward the right side of the screen.
1. Select the main branch as the target for the release.
1. Enter a unique tag for the new version following your project's versioning system. This tag will be used to identify this specific release.
1. Under "Release title", give a short, meaningful name for the release.
1. Make sure "Generate Release Notes" option is selected.
*GitHub will automatically include a changelog of all commit messages since your last release.*
1. Hit "Choose a tag" and enter a unique tag for the new version following [semver](https://semver.org/) rules. This tag must match the tag used in [Updating Self-Dependencies](#updating-self-dependencies) step. Hit "Create new tag".
1. Click "Generate Release Notes". GitHub will automatically include a changelog of all commit messages since last release.
1. Once all the details are finalized, click on the "Publish release" button.
11 changes: 11 additions & 0 deletions update-self-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

read -p "Enter the next (predicted) version tag (e.g., 1.0.1): " next_version

# Define the search pattern
search_pattern="epam/ai-dial-ci/"

# Find all .yml and .yaml files and replace the version tag
find . -type f \( -name "*.yml" -o -name "*.yaml" \) -exec sed -i "s|\(${search_pattern}[^@]*@\)[^ ]*|\1${next_version}|g" {} +

echo "Updated all occurrences of '${search_pattern}' with version '${next_version}'."

0 comments on commit be3770d

Please sign in to comment.