-
Notifications
You must be signed in to change notification settings - Fork 24
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
ci: post upon release #195
Conversation
WalkthroughThe pull request modifies the GitHub Actions workflow file for posting to Mastodon. The change focuses on refining the job execution conditions in the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
.github/workflows/post_to_mastodon.yml (1)
Action version should be pinned and upgraded
Please update the workflow:
- Pin the action version to a specific release instead of major version
v2
- Consider upgrading to
v3.0.0
which includes Node 20 compatibility improvements🔗 Analysis chain
Line range hint
21-31
: Verify workflow dependencies and script permissions.Please ensure:
- The shell script exists and has the correct permissions
- The action versions are pinned to secure versions
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if the shell script exists and is executable if [ -f ".github/workflows/post_to_mastodon.sh" ]; then ls -l .github/workflows/post_to_mastodon.sh else echo "Warning: post_to_mastodon.sh not found" fi # Check action versions in the marketplace gh api -X GET /repos/nick-fields/retry/releases/latestLength of output: 2201
🧰 Tools
🪛 yamllint (1.35.1)
[error] 17-17: trailing spaces
(trailing-spaces)
🧹 Nitpick comments (2)
.github/workflows/post_to_mastodon.yml (2)
15-17
: Consider expanding version pattern matching.The current condition might miss some common version patterns. Consider these improvements:
- Remove the space requirement before 'v' to catch patterns like 'v1.0.0'
- Add support for more version formats
if: | github.event.pull_request.merged == true && - (startsWith(github.event.pull_request.title, 'release') || contains(github.event.pull_request.title, ' v')) + (startsWith(github.event.pull_request.title, 'release') || contains(github.event.pull_request.title, 'v') || contains(github.event.pull_request.title, 'version'))🧰 Tools
🪛 yamllint (1.35.1)
[error] 17-17: trailing spaces
(trailing-spaces)
17-17
: Remove trailing spaces.There are trailing spaces at the end of line 17.
- (startsWith(github.event.pull_request.title, 'release') || contains(github.event.pull_request.title, ' v')) + (startsWith(github.event.pull_request.title, 'release') || contains(github.event.pull_request.title, ' v'))🧰 Tools
🪛 yamllint (1.35.1)
[error] 17-17: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/post_to_mastodon.yml
(1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/post_to_mastodon.yml
[error] 17-17: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: testing
@coderabbitai now, upon release, the action does not run: https://github.com/snakemake/snakemake-executor-plugin-slurm/actions/runs/12870026000 Apparently, the suggested fix does not work. Ideas how to fix this? |
Tip For best results, initiate chat on the files or code changes. @cmeesters I found the issue. The post_to_mastodon workflow is currently configured to run on PR merges, but releases are being created directly by the release-please action without going through PRs. Here's how we can fix it: name: Post to Mastodon on Release
on:
release:
types: [published]
permissions:
contents: read
jobs:
post_to_mastodon:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Post to Mastodon
uses: nick-fields/retry@v2
with:
timeout_minutes: 2
max_attempts: 3
command: |
export MASTODONBOT="${{ secrets.MASTODONBOT }}"
export PR_TITLE="release v${{ github.event.release.tag_name }}"
chmod +x $GITHUB_WORKSPACE/.github/workflows/post_to_mastodon.sh
$GITHUB_WORKSPACE/.github/workflows/post_to_mastodon.sh This modification:
Would you like me to create an issue to track this change? 🔗 Analysis chain🏁 Scripts executedThe following scripts were executed for the analysis: Script:
Length of output: 938 Script:
Length of output: 47 Script:
Length of output: 1599 Script:
Length of output: 1212 |
attempting fix
Summary by CodeRabbit