-
Notifications
You must be signed in to change notification settings - Fork 2
Align 1952 with main #21
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
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
02df786
target_uploads function
mwinokan f306b59
Merge remote-tracking branch 'origin/main'
mwinokan 9d863e4
docs: Adjust changelog for 2026.01.1
f8f92ef
docs: Add changelog for 2026.02.1
5aa5f1c
docs: Add link to fragalysis-database repo
66af26e
ci: Add xchem-style release files
995e4ce
Merge pull request #19 from xchem/m2ms-2076
alanbchristie b16eacc
build: Fix release (missing packages and pandas)
f9c7420
docs: fragalysis-package now fragutils
21a56ba
ci: Fix the environment url
6c53f6b
docs: A note about repo adoption and trunk-based development
1f45253
feat: Switch to pyproject for pacakge build
48b8d40
Merge pull request #20 from xchem/switch-to-pyproject
alanbchristie 5ac1e69
docs: Readme tweak
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 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
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 |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| --- | ||
| # The standard xchem Python package release process. | ||
| # Run on 'Release' and published to PyPI as a 'trusted' publisher. | ||
| # | ||
| # See https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/ | ||
| # See https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
| name: Release | ||
|
|
||
| on: | ||
| release: | ||
| types: | ||
| - published | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build distribution | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Inject slug/short variables | ||
| uses: rlespinasse/github-slug-action@v5 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: '3.x' | ||
| - name: Install build package | ||
| run: | | ||
| pip install --upgrade pip | ||
| pip install uv --user | ||
| - name: Build | ||
| run: | | ||
| uv version $GITHUB_REF_SLUG | ||
| uv build | ||
| - name: Store the distribution | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: python-package-distribution | ||
| path: dist/ | ||
|
|
||
| publish: | ||
| name: Publish to PyPI | ||
| needs: | ||
| - build | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/p/xchem-fragalysis | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - name: Download distribution | ||
| uses: actions/download-artifact@v6 | ||
| with: | ||
| name: python-package-distribution | ||
| path: dist/ | ||
| - name: Publish | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 5 months ago
In general, the fix is to explicitly restrict the
GITHUB_TOKENpermissions for the workflow/jobs so they only have the minimum required access. For this workflow, thebuildjob only needs to read repository contents and interact with artifacts; it does not need to write to the repo, issues, or PRs. Thepublishjob already correctly grantsid-token: writeand otherwise inherits defaults, so we can keep that as-is or further restrict if desired; the CodeQL finding is specifically on thebuildjob.The best minimal fix without changing existing functionality is to add a
permissionsblock to thebuildjob that limitscontentstoread. This satisfies CodeQL’s recommendation (contents: readas a minimal starting point), matches whatactions/checkoutrequires, and avoids unintentionally broad write permissions. Concretely, in.github/workflows/release.yaml, insidejobs.build(belowruns-on: ubuntu-latestis a clear spot), add:No new imports or methods are needed; this is purely a workflow YAML change.