-
Notifications
You must be signed in to change notification settings - Fork 66
chore: commit generated references with GitHub App #546
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
Merged
+26
−52
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -68,7 +68,6 @@ jobs: | |
| environment: "Release" # This will require an approval from a maintainer, they are notified in Slack above | ||
| permissions: | ||
| contents: write | ||
| actions: write | ||
| id-token: write | ||
| steps: | ||
| - name: Notify Slack - Approved | ||
|
|
@@ -194,11 +193,34 @@ jobs: | |
| NEW_VERSION: ${{ steps.sampo-release.outputs.new_version }} | ||
| run: gh release create "$NEW_VERSION" --generate-notes | ||
|
|
||
| - name: Dispatch generate-references | ||
| - name: Generate references | ||
| if: steps.commit-release.outputs.commit-hash != '' | ||
| run: | | ||
| uv run bin/docs generate-references | ||
|
|
||
| - name: Check for changes in references | ||
| if: steps.commit-release.outputs.commit-hash != '' | ||
| id: references-changes | ||
| run: | | ||
| if [ -n "$(git status --porcelain references/)" ]; then | ||
| echo "changed=true" >> "$GITHUB_OUTPUT" | ||
| echo "New references generated in references directory:" | ||
| git status --porcelain references/ | ||
| else | ||
| echo "changed=false" >> "$GITHUB_OUTPUT" | ||
| echo "No new references generated in references directory" | ||
| fi | ||
|
|
||
| - name: Commit generated references | ||
| if: steps.commit-release.outputs.commit-hash != '' && steps.references-changes.outputs.changed == 'true' | ||
| uses: planetscale/ghcommit-action@25309d8005ac7c3bcd61d3fe19b69e0fe47dbdde # v0.2.20 | ||
| with: | ||
| commit_message: "Update generated references" | ||
| repo: ${{ github.repository }} | ||
| branch: main | ||
| file_pattern: references/ | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: gh workflow run generate-references.yml --ref main | ||
| GITHUB_TOKEN: ${{ steps.releaser.outputs.token }} | ||
|
Member
Author
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. we need this to live here because of the GH token, otherwise it'd require a 2nd environment approval |
||
|
|
||
| # Notify in case of a failure | ||
| - name: Send failure event to PostHog | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we need a continue on error for these next steps? Low context from me here but if the package is released and externally visible I think we should not fail. Plus previous impl was just dispatching to another workflow so any failures were isolated there and did not affect this one
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.
i dont disagree but this is exactly what happened before
generate references was failing and we didnt notice for quite a while
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.
Could this be a warning message on slack?
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.
since this is executed after release, github release etc the release will work anyway, and if references failed, we can just fix forward
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.
yes, its gonna be a failed release, so the slack thread gets updated, we know that it partly failed, fix forward and thats it
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.
we can change if this often fails and its breaking releases
we tried the other way, we had this broken for a few weeks, now we try the other way