-
Notifications
You must be signed in to change notification settings - Fork 188
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
Less release steps #1793
base: main
Are you sure you want to change the base?
Less release steps #1793
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Auto-update spec repo links | ||
on: | ||
schedule: | ||
# hourly at minute 46 | ||
- cron: "46 * * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check-versions: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
current-version: ${{ steps.check-versions.outputs.current-version }} | ||
latest-version: ${{ steps.check-versions.outputs.latest-version }} | ||
already-opened: ${{ steps.check-versions.outputs.already-opened }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- id: check-versions | ||
name: Check versions | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
current_version=$(grep "PREVIOUS_SPECIFICATION_VERSION=v.*" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be getting the value of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I totally follow, I think I removed the need for that step by only maintaining a single version in the file (which aligns with the version currently used in the links) |
||
internal/tools/update_specification_version.sh \ | ||
| sed "s/PREVIOUS_SPECIFICATION_VERSION=//") | ||
latest_version=$(gh release view \ | ||
--repo open-telemetry/opentelemetry-specification \ | ||
--json tagName \ | ||
--jq .tagName) | ||
|
||
matches=$(gh pr list \ | ||
--author opentelemetrybot \ | ||
--state open \ | ||
--search "in:title \"Update spec repo links to $latest_version\"") | ||
if [ ! -z "$matches" ] | ||
then | ||
already_opened=true | ||
fi | ||
|
||
echo "current-version=$current_version" >> $GITHUB_OUTPUT | ||
echo "latest-version=$latest_version" >> $GITHUB_OUTPUT | ||
echo "already-opened=$already_opened" >> $GITHUB_OUTPUT | ||
|
||
update-spec-repo-links: | ||
runs-on: ubuntu-latest | ||
if: | | ||
needs.check-versions.outputs.current-version != needs.check-versions.outputs.latest-version && | ||
needs.check-versions.outputs.already-opened != 'true' | ||
needs: | ||
- check-versions | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Use CLA approved github bot | ||
run: .github/scripts/use-cla-approved-github-bot.sh | ||
|
||
- name: Update version | ||
env: | ||
VERSION: ${{ needs.check-versions.outputs.latest-version }} | ||
run: | | ||
.github/scripts/update-spec-repo-links.sh $VERSION | ||
sed -i "s/^PREVIOUS_SPECIFICATION_VERSION=.*/PREVIOUS_SPECIFICATION_VERSION=$VERSION/" .github/scripts/update-spec-repo-links.sh | ||
|
||
- name: Create pull request | ||
env: | ||
VERSION: ${{ needs.check-versions.outputs.latest-version }} | ||
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows | ||
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} | ||
run: | | ||
message="Update spec repo links to $VERSION" | ||
body="Update spec repo links to \`$VERSION\`." | ||
branch="opentelemetrybot/update-spec-repo-links-to-$VERSION" | ||
|
||
git checkout -b $branch | ||
git commit -a -m "$message" | ||
git push --set-upstream origin $branch | ||
gh pr create --title "$message" \ | ||
--body "$body" \ | ||
--label "Skip Changelog" \ | ||
--base main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file needed to be outside of the
workflows
directory in order for the automation to be able to update it, so I went ahead and moved all of the scripts to the same place