Bump actions/setup-node from 3.6.0 to 4.0.3 #42
This file contains 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
name: Run test-ring-1 on comment | |
on: | |
issue_comment: | |
types: [created, edited] | |
jobs: | |
comment_trigger: | |
runs-on: ubuntu-latest | |
outputs: | |
triggerTestRing1: ${{ steps.check_comment.outputs.result }} | |
headSha: ${{ steps.pr_info.outputs.headSha }} | |
headRef: ${{ steps.pr_info.outputs.headRef }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: check_comment | |
uses: actions/github-script@v4 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const comment = context.payload.comment.body.trim(); | |
const startsWithTestRing1 = comment.startsWith('/test-ring-1'); | |
console.log('Comment starts with "/test-ring-1":', startsWithTestRing1); | |
return startsWithTestRing1; | |
- id: pr_info | |
if: steps.check_comment.outputs.result == 'true' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
shell: bash | |
run: | | |
headInfo=$(gh pr view ${{ github.event.issue.number }} --json headRefName,headRefOid) | |
echo "Head Info: $headInfo" | |
echo "headSha=$(echo $headInfo | jq -r '.headRefOid')" >> $GITHUB_OUTPUT | |
echo "headRef=$(echo $headInfo | jq -r '.headRefName')" >> $GITHUB_OUTPUT | |
trigger-test-ring-1: | |
needs: comment_trigger | |
runs-on: ubuntu-latest | |
if: needs.comment_trigger.outputs.triggerTestRing1 == 'true' | |
steps: | |
- shell: bash | |
run: | | |
echo "Running test-ring-1" | |
echo "Head SHA: ${{ needs.comment_trigger.outputs.headSha }}" | |
echo "Head Ref: ${{ needs.comment_trigger.outputs.headRef }}" |