Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ deployments/.env
#ignore docker compose file
deployments/docker-compose.yaml
.DS_Store
.env
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: $GITHUB_ACTOR
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Generate a container image
run: |
version=$(cat VERSION)
docker build . -t ghcr.io/${USERNAME_OR_ORG}/github-updates:${version}
docker push ghcr.io/${USERNAME_OR_ORG}/github-updates:${version}
shell: bash
env:
USERNAME_OR_ORG: "${{ github.repository_owner }}"
- name: Increment the pom version
run: |
current_version=$(cat VERSION)
if [[ "$current_version" =~ v([0-9]+)\.([0-9]+) ]]; then
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
else
echo "Invalid version format. Expected format: v<major>.<minor>"
exit 1
fi
minor=$((minor + 1))
new_version="v${major}.${minor}"
echo "$new_version" > VERSION
shell: bash
- name: Create Pull Request with new PRs
uses: peter-evans/create-pull-request@v3
with:
token: "${{ secrets.GITHUB_TOKEN }}"
branch-suffix: timestamp
title: Increment version after release
labels: auto-version-increment
signoff: true
delete-branch: false
commit-message: Auto increment version after release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ assets/generated-data/*.json
# Ignore .env file
deployments/.env
.DS_Store
.env
19 changes: 11 additions & 8 deletions internal/pkg/client/ghclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,15 @@ func (c Client) IssueWithLabels(org string, repos []string, issueLabels []string
}
for _, issue := range issues {

publishedDate := issue.GetCreatedAt()
startDate := time.Now().AddDate(0, 0, dayDiff)
log.Println("publishedDate", publishedDate, "start date", startDate, " if condition", publishedDate.Before(startDate))

if publishedDate.Before(startDate) {
issueDateReached = true
break
if dayDiff != 0 {
publishedDate := issue.GetCreatedAt()
startDate := time.Now().AddDate(0, 0, dayDiff)
log.Println("publishedDate", publishedDate, "start date", startDate, " if condition", publishedDate.Before(startDate))

if publishedDate.Before(startDate) {
issueDateReached = true
break
}
}

//check if the issue contains the desired labels or not
Expand Down Expand Up @@ -287,7 +289,8 @@ func (c Client) IssueWithLabels(org string, repos []string, issueLabels []string
return issueList, nil
}

/**
/*
*
Utility function to check if the issue contains at least one of the desired labels
*/
func doesIssueContainLabels(issue *github.Issue, allowedLabels []string) bool {
Expand Down