Skip to content

Conversation

@numbata
Copy link
Contributor

@numbata numbata commented Dec 7, 2025

Switch to tokenless execution using with GitHub Actions annotations for inline feedback. This eliminates the need for the grape-bot token while still providing PR feedback via workflow annotations.

Changes:

  • Use commit SHAs instead of branch refs for reliable diff calculation
  • Output violations as GitHub Actions annotations (errors, warnings, notices)
  • Update to actions/checkout@v6 with full history fetch

@numbata numbata force-pushed the fix_danger_workflow branch 4 times, most recently from d7dc3d5 to eb222e4 Compare December 7, 2025 02:36
@numbata numbata force-pushed the fix_danger_workflow branch from 83a0487 to acb1640 Compare December 15, 2025 02:17
@numbata
Copy link
Contributor Author

numbata commented Dec 15, 2025

Dependent on dblock/danger-changelog#66 now

runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request'
steps:
- name: Checkout
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, to have .github/scripts/post-danger-comment.js on "Post or Update PR Comment" step, but maybe I'll just move back to have it inline in here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's checking out the code from upstream, right? Otherwise you can inject things here. All good with me.

If possible to package it that'd be best, but can be taken care of later.

@@ -0,0 +1,82 @@
const fs = require('fs');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way we can package and release this as part of grape-danger?

@dblock
Copy link
Member

dblock commented Dec 16, 2025

I'm good with this!

Can we move some/most/all of these things into https://github.com/ruby-grape/danger? Otherwise let's work on archiving that repo.

@numbata
Copy link
Contributor Author

numbata commented Dec 16, 2025

@dblock We can't move workflows totally to ruby-grape-danger. Something will stay here. But we can try to reuse workflows from danger by something like:

# .github/workflows/danger.yml
name: Danger
on:
  pull_request:
    types: [opened, reopened, edited, synchronize]
jobs:
  danger:
    uses: uses: ruby-grape/danger/.github/workflows/danger-run.yml@main
    secrets: inherit

and

# .github/workflows/danger-comment.yml
name: Danger Comment
on:
  workflow_run:
    workflows: [Danger]
    types: [completed]
permissions:
  actions: read
  contents: read
  issues: write
  pull-requests: write
jobs:
  comment:
    if: github.event.workflow_run.event == 'pull_request'
    uses: uses: ruby-grape/danger/.github/workflows/danger-comment.yml@main
    with:
      run-id: ${{ github.event.workflow_run.id }}
    secrets: inherit

@dblock
Copy link
Member

dblock commented Dec 16, 2025

@numbata cool, up to you when you want to refactor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants