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

ci: use explicit tag range on changelog generation #4361

Merged
merged 3 commits into from
Mar 16, 2024
Merged
Changes from all 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
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ jobs:
count: ${{ steps.env_vars.outputs.count }}
tag_name: ${{ steps.env_vars.outputs.tag_name }}
release_name: ${{ steps.env_vars.outputs.release_name }}
yesterday_tag_name: ${{ steps.env_vars.outputs.yesterday_tag_name }}
steps:
- uses: actions/checkout@v4
- id: env_vars
run: |
TAG_NAME=$(date -u --iso-8601 --date='1 day ago')
YESTERDAY_TAG_NAME=$(date -u --iso-8601 --date='2 day ago')
COMMITS=$(git log --oneline --since="$TAG_NAME" | wc -l)
RELEASE_NAME="Experimental $TAG_NAME"

echo "commits yesterday ($TAG_NAME): $COMMITS" >> "$GITHUB_STEP_SUMMARY"

echo "count=$COMMITS" >> "$GITHUB_OUTPUT"
echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT"
echo "yesterday_tag_name=$YESTERDAY_TAG_NAME" >> "$GITHUB_OUTPUT"
echo "release_name=$RELEASE_NAME" >> "$GITHUB_OUTPUT"

release:
Expand Down Expand Up @@ -59,15 +62,13 @@ jobs:
custom_tag: ${{ needs.metadata.outputs.tag_name }}
tag_prefix: ""

- uses: actions/checkout@v4

- run: git fetch origin tag ${{ needs.metadata.outputs.tag_name }} --no-tags

- name: Build Changelog
id: build_changelog
uses: mikepenz/[email protected]
with:
configuration: "changelog.json"
fromTag: ${{ needs.metadata.outputs.yesterday_tag_name }}
toTag: ${{ needs.metadata.outputs.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
Loading