Skip to content
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

chore: created a new github action to handle new comments better #26234

Merged
23 changes: 0 additions & 23 deletions .github/workflows/triage_add_stale_issue_to_board.yml

This file was deleted.

104 changes: 0 additions & 104 deletions .github/workflows/triage_closed_issue_comment.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/triage_handle_new_comments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Handle Issue/PR Comment Workflow'
on:
# makes this workflow reusable
nagash77 marked this conversation as resolved.
Show resolved Hide resolved
workflow_call:
secrets:
TRIAGE_BOARD_TOKEN:
required: true

issue_comment:
types: [created]

jobs:
handle-comment-scenarios:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: 'cypress-io/release-automations'
ref: 'master'
ssh-key: ${{ secrets.WORKFLOW_DEPLOY_KEY }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this secret also need to be included in the workflow call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no this secret is needed to checkout a private repo.

- name: Set up Node.js
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the default version of node on the runner?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They switch when a new version becomes LTS. I believe it is currently 16 but will likely switch to 18 sometime in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

The default Node.js on all GitHub runners is currently 18.15.0 and probably there is no need to select Node.js 16 explicitly here.

(I know that this PR is closed! I'm just looking at it because it has broken other workflows. That has nothing to do with the Node.js version however.)

uses: actions/setup-node@v3
with:
node-version: '16'
- name: Run comment_workflow.js Script
uses: actions/github-script@v6
with:
github-token: ${{ secrets.TRIAGE_BOARD_TOKEN }}
script: |
const script = require('./scripts/triage/comment_workflow.js')
await script.handleComment(github, context);