-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove codeql.yml * update go and dependencies * update actions * Add changlog releaser. Update changelog. Update docs. * fix lint config
- Loading branch information
Showing
16 changed files
with
299 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: CHANGELOG.md Check | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
verify_changelog_job: | ||
runs-on: ubuntu-latest | ||
name: Did CHANGELOG.md change? | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: fetch | ||
run: git fetch | ||
- name: run changelog.sh | ||
run: 'bash ${GITHUB_WORKSPACE}/.github/workflows/scripts/changelog.sh' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Release by Changelog | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Branch to create a release from' | ||
required: true | ||
default: 'main' | ||
version: | ||
description: 'Specify the semantic version for the release (vX.Y.Z)' | ||
required: true | ||
reason: | ||
description: 'Reason for the manual release' | ||
required: false | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
GOPROXY: proxy.golang.org,direct | ||
GOPRIVATE: github.com/c2fo,github.com/C2FO | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.branch || github.ref_name }} | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.24 | ||
|
||
- name: Install and run ReleaseGen | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPOSITORY: ${{ github.repository }} | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_REF_NAME: ${{ github.event.inputs.branch || github.ref_name }} | ||
MANUAL_VERSION: ${{ github.event.inputs.version || '' }} | ||
REASON: ${{ github.event.inputs.reason || '' }} | ||
CUSTOM_CHANGE_TYPES: | | ||
documentation:patch | ||
run: | | ||
git config --global url."https://c2fo-read-only:${{ secrets.GH_CI_READ }}@github.com/c2fo".insteadOf "https://github.com/c2fo" | ||
go install github.com/c2fo/ep-tools/releasegen@latest | ||
releasegen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Find all directories containing a CHANGELOG.md file | ||
changelogDirs=$(find . -type f -name 'CHANGELOG.md' -exec dirname {} \;) | ||
|
||
# Check each directory for changes and ensure CHANGELOG.md is updated | ||
for dir in $changelogDirs; do | ||
echo "Checking directory: $dir" | ||
|
||
# Check if there are any changes in the directory | ||
dirChanges=$(git --no-pager diff -w --numstat origin/main -- $dir | wc -l) | ||
if [[ "$dirChanges" -gt 0 ]]; then | ||
echo "Changes detected in $dir" | ||
|
||
# Check if CHANGELOG.md has been modified | ||
changelogMod=$(git --no-pager diff -w --numstat origin/main -- $dir/CHANGELOG.md) | ||
if [[ -z "$changelogMod" ]]; then | ||
echo "CHANGELOG.md in $dir has not been modified. Please update it with your changes before merging to main." | ||
exit 1 | ||
else | ||
echo "CHANGELOG.md in $dir has been modified. Verifying at least 1 (non-whitespace) line has been added." | ||
changelogLines=$(echo "$changelogMod" | awk '{print $1}') | ||
if [[ "$changelogLines" -lt 1 ]]; then | ||
echo "Didn't detect any substantial changes to CHANGELOG.md in $dir." | ||
exit 1 | ||
else | ||
echo "Detected '$changelogLines' new non-whitespace lines in CHANGELOG.md in $dir. Thanks +1" | ||
fi | ||
fi | ||
else | ||
echo "No changes detected in $dir" | ||
fi | ||
done | ||
|
||
echo "All directories with changes have updated CHANGELOG.md files." | ||
exit 0 |
Oops, something went wrong.