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

Fix: Changelog generator action frfr no cap #6659

Merged
merged 2 commits into from
Jan 15, 2025
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
42 changes: 25 additions & 17 deletions .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,34 @@ jobs:
run: |
git config --global user.name 'sourcegraph-bot'
git config --global user.email 'bot@sourcegraph.com'
- name: Update version
git fetch --tags origin
git checkout main
git pull
- name: Download changelog
env:
VERSION: ${{ github.event.inputs.version }}
GH_TOKEN: ${{ secrets.DEVX_SERVICE_GH_TOKEN }}
run: |
set +x
# git checkout -b version-update/$VERSION
sed -i 's/"version": "[0-9]\+\.[0-9]\+\.[0-9]\+"/"version": "'$VERSION'"/' vscode/package.json
# This will get tagged along with the changelog PR
git add vscode/package.json
git status
git commit -m "Update version to $VERSION"
# Download and run changelog generator
tagName=$(gh release -R sourcegraph/devx-service list --exclude-drafts --exclude-pre-releases -L 1 --json tagName -q '.[] | .tagName')
gh release -R sourcegraph/devx-service download ${tagName} --pattern changelog
chmod +x changelog
- name: Generate changelog
env:
GH_TOKEN: ${{ secrets.DEVX_SERVICE_GH_TOKEN }}
GH_REPO: "sourcegraph/cody"
CHANGELOG_SKIP_NO_CHANGELOG: "true"
CHANGELOG_COMPACT: "true"
VERSION: ${{ github.event.inputs.branchenv.VERSION }}
VERSION: ${{ github.event.inputs.version }}
run: |
set +x
# Get previous tag's commit
git fetch --tags origin
PREV_TAG=$(git tag --sort=-v:refname | grep '^vscode-v' | head -n 2 | tail -n 1)
export RELEASE_LATEST_RELEASE=$(git rev-parse $PREV_TAG)

# Get current release commit
export RELEASE_LATEST_COMMIT=$(git rev-parse HEAD)

# Download and run changelog generator
tagName=$(gh release -R sourcegraph/devx-service list --exclude-drafts --exclude-pre-releases -L 1 --json tagName -q '.[] | .tagName')
gh release -R sourcegraph/devx-service download ${tagName} --pattern changelog
chmod +x changelog

echo "Latest Commit: $RELEASE_LATEST_COMMIT"
echo "Latest Release: $RELEASE_LATEST_RELEASE"
./changelog update-as-pr \
--github.repo=$GH_REPO \
--output.repo.base="main" \
Expand All @@ -73,3 +68,16 @@ jobs:
# --title "VS Code: Release v$VERSION" \
# --body "Automated release and changelog for VS code Cody" \
# --base main --head release/vscode-v$VERSION
- name: Update version
env:
VERSION: ${{ github.event.inputs.version }}
run: |
set +x
# git checkout -b version-update/$VERSION
sed -i 's/"version": "[0-9]\+\.[0-9]\+\.[0-9]\+"/"version": "'$VERSION'"/' vscode/package.json
# This will get tagged along with the changelog PR
git add vscode/package.json
git pull
git checkout release/vscode-$VERSION
git commit -m "Update version to $VERSION"
git push
Loading