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

Added: Changelog Feature #61

Draft
wants to merge 51 commits into
base: testnet
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8248889
Rename Changelog to Changelog.md
Kille135 Mar 28, 2024
978978c
Added Changelog.yml
Kille135 Mar 28, 2024
491ede5
Update Changelog.yml
Kille135 Mar 28, 2024
8733dab
Update Changelog.yml
Kille135 Mar 28, 2024
3b80088
Added Changelog generation and Pull Request message validation
Kille135 Mar 28, 2024
44f7072
Update deploy-testnet.yml
Kille135 Mar 28, 2024
5d37cfb
Fixed docker image push in CI/CD workflow (#57)
Kille135 Mar 28, 2024
2111d3d
Update Changelog.yml
Kille135 Mar 28, 2024
bcff82b
Update Changelog.yml
Kille135 Mar 28, 2024
d128529
Update Changelog.yml
Kille135 Mar 28, 2024
4a89339
Added: Pull-Request title check and Changelog feature (#59)
Kille135 Mar 28, 2024
1aca207
Update Changelog.yml
Kille135 Mar 28, 2024
2f2800d
Update Changelog.yml
Kille135 Mar 28, 2024
04da366
Delete .github/workflows/Changelog.yml
Kille135 Mar 28, 2024
80b37ef
Changelog CI deleted
Kille135 Mar 28, 2024
bd154a0
Create changelog.yml
Kille135 Mar 28, 2024
7daaa9c
Update changelog.yml
Kille135 Mar 28, 2024
db9437c
Update changelog.yml
Kille135 Mar 31, 2024
2e82ccd
Update changelog.yml
Kille135 Mar 31, 2024
537b4e3
Update changelog.yml
Kille135 Mar 31, 2024
8e25e82
Update changelog.yml
Kille135 Mar 31, 2024
65a0a7a
Update changelog.yml
Kille135 Mar 31, 2024
e712e64
Update changelog.yml
Kille135 Mar 31, 2024
c47470b
Update changelog.yml
Kille135 Mar 31, 2024
a860b6a
Update changelog.yml
Kille135 Mar 31, 2024
7075dff
Update changelog.yml
Kille135 Apr 1, 2024
1f569a2
Update changelog.yml
Kille135 Apr 1, 2024
96b44c0
Update changelog.yml
Kille135 Apr 1, 2024
3b00c83
Update changelog.yml
Kille135 Apr 1, 2024
0c905f6
Update changelog.yml
Kille135 Apr 1, 2024
615e1e0
Update changelog.yml
Kille135 Apr 1, 2024
2c3e6f3
Update changelog.yml
Kille135 Apr 1, 2024
14ba853
Update changelog.yml
Kille135 Apr 1, 2024
19ab5d3
Update changelog.yml
Kille135 Apr 1, 2024
253a7b3
Update changelog.yml
Kille135 Apr 1, 2024
cbfd010
Update changelog.yml
Kille135 Apr 1, 2024
c979e6c
Update changelog.yml
Kille135 Apr 1, 2024
2c3a57c
Update changelog.yml
Kille135 Apr 1, 2024
97bdef4
Update changelog.yml
Kille135 Apr 1, 2024
6bcba4c
Update changelog.yml
Kille135 Apr 1, 2024
bfb3cf8
Update changelog.yml
Kille135 Apr 1, 2024
c64c3aa
Update changelog.yml
Kille135 Apr 1, 2024
5330043
Update changelog.yml
Kille135 Apr 1, 2024
7c74eb1
Update changelog.yml
Kille135 Apr 1, 2024
21e25c2
Update changelog.yml
Kille135 Apr 1, 2024
4e70f4c
Update changelog.yml
Kille135 Apr 1, 2024
b9d82fb
Update changelog.yml
Kille135 Apr 1, 2024
75f9b24
Update changelog.yml
Kille135 Apr 1, 2024
065bba7
Update changelog.yml
Kille135 Apr 1, 2024
f172fc6
Update changelog.yml
Kille135 Apr 1, 2024
2f8fe61
Update Changelog with changes from pull request #61
actions-user Apr 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Pull Request Workflow
permissions:
contents: write
pull-requests: write
on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
validate-pr:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Check PR Title Format
run: |
PR_TITLE=$(jq -r ".pull_request.title" "$GITHUB_EVENT_PATH")
# Check if the pull request title matches the required format
if ! echo "$PR_TITLE" | grep -qE '^(Added|Changed|Deprecated|Removed|Fixed|Security): .+$'; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here that it violates our style guideline for commmit messages, particularly:

  • the first word is a verb, but not in imperative form
  • it has punctuation symbols we don't need

But it's ok to restrict the words list for merge commits to: "Add", "Change", "Deprecate", "Remove", "Fix". Don't know what to do about "Security". Can we remove it completely?

Also, we need to update our contributing guideline accordingly (the title of a PR can have only these words and the merge request message should be the same as the PR title).

echo "Pull request title '$PR_TITLE' does not match the required format."
echo "::error::Pull request title does not match the required format."
exit 1
fi

- name: pull branch updates
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git config pull.rebase true
git pull origin ${{ github.head_ref }}

- name: Update Changelog
if: success()
run: |
# Extract version and date from previous changelog entry
PREVIOUS_VERSION=$(grep -oP '(?<=## \[)[^\]]+' Changelog.md | head -n 1)
DATE=$(date +'%Y-%m-%d')
CHANGELOG_ENTRY="**[${PREVIOUS_VERSION}] - ${DATE}**\n$(jq -r ".pull_request.title" "$GITHUB_EVENT_PATH" | sed 's/^[^:]*: //' | sed 's/^/* /')"
# Update changelog file
sed -i "1s/^/${CHANGELOG_ENTRY}\n\n/" Changelog.md
- name: Commit and Push Changelog Update
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add Changelog.md
git commit -m "Update Changelog with changes from pull request #${{ github.event.number }}"
git push origin HEAD:${{ github.head_ref }}
15 changes: 8 additions & 7 deletions .github/workflows/deploy-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@ jobs:
- name: Login to Docker Hub
run: docker login -u atletanetwork -p ${{ secrets.REGISTRYPASS }} docker.io

- name: Build and Tag Docker Image

- name: DATE and HMS variables
run: |
DATE=$(date +%d%m%y)
HMS=$(date +%H%M%S)
echo "DATE: $DATE, HMS: $HMS"

- name: Build and Push Docker Image
run: |
docker build -t docker.io/atletanetwork/atleta-node:testnet-${DATE}-${HMS} .
docker tag docker.io/atletanetwork/atleta-node:testnet-${DATE}-${HMS} docker.io/atletanetwork/atleta-node:testnet-latest
docker push docker.io/atletanetwork/atleta-node:testnet-${DATE}-${HMS}
docker push docker.io/atletanetwork/atleta-node:testnet-latest


- name: Push Docker Image
run: |
docker push docker.io/atletanetwork/atleta-node:testnet-latest
docker push docker.io/atletanetwork/atleta-node:testnet-${DATE}-${HMS}


- name: Set up SSH
run: |
mkdir -p ~/.ssh/
Expand Down
3 changes: 3 additions & 0 deletions Changelog → Changelog.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
**[] - 2024-04-01**
* Changelog Feature

[0.0.1]
Here is the start of the ChangeLog