-
Notifications
You must be signed in to change notification settings - Fork 6
ci: record releases in Linear, pin and update workflow actions #300
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
Changes from 1 commit
2aa23d2
ea1d37a
b41ec03
7f749ba
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 |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ jobs: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| # hatch-vcs derives the version from git tags, so we need full history. | ||
| fetch-depth: 0 | ||
|
|
@@ -46,7 +46,7 @@ jobs: | |
| ls -l dist/ | ||
|
|
||
| - name: Store the distribution packages | ||
| uses: actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
|
|
@@ -81,13 +81,13 @@ jobs: | |
|
|
||
| steps: | ||
| - name: Download distribution packages | ||
| uses: actions/download-artifact@v4 | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1 | ||
|
|
||
| - name: Notify Slack (success) | ||
| if: ${{ success() && env.SLACK_WEBHOOK_URL != '' }} | ||
|
|
@@ -102,3 +102,27 @@ jobs: | |
| curl -s -X POST "$SLACK_WEBHOOK_URL" \ | ||
| -H 'Content-type: application/json' \ | ||
| --data "{\"text\":\"*Codeplain Client*: Publishing \`${{ github.ref_name }}\` to PyPI FAILED :x:. See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.\"}" | ||
|
|
||
| # Runs only after the package is on PyPI. Kept as its own job so the publish job | ||
| # keeps its minimal permissions and no checkout. | ||
| linear-release: | ||
| name: Record release in Linear | ||
| needs: publish-to-pypi | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| # The scan needs full history. | ||
| fetch-depth: 0 | ||
|
|
||
| # Non-fatal: the package is already published. | ||
| - name: Record release in Linear | ||
| continue-on-error: true | ||
| uses: linear/linear-release-action@0a25abab892a91062ebf42260dbb2ce6277aa205 # v0.16.0 | ||
|
Contributor
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. Just leaving a note here. This SHA pins the install script that downloads the binary which is then the linear CLI and not the CLI itself. Which only half solves the security issues.
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. Correct. Pinning the action fixes the code that runs, not the binary it downloads at runtime. CLI pinned to version tag now. |
||
| with: | ||
| access_key: ${{ secrets.LINEAR_ACCESS_KEY }} | ||
| version: ${{ github.ref_name }} | ||
|
Contributor
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. If this step fails nothing will get logged anywhere. For the
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. Good catch, fixed in ea1d37a. |
||
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.
Same as in plain-forge repo - I think it would be better to stay consistent with pins so as to avoid any discrepancies and catch issues early rather than in the deploy job.
This applies also to all other un-pinned actions.
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.
Agreed, and done.