Skip to content

Commit

Permalink
Added Actions that respond to specific labels
Browse files Browse the repository at this point in the history
  • Loading branch information
pacificbelt30 committed May 1, 2024
1 parent 8238907 commit 47055d3
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/alert-menta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Reacts to specific labels
run-name: ${{ github.actor }} is testing out GitHub Actions πŸš€
on:
issues:
types: [labeled] # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issues

jobs:
Issue_Reaction:
if: contains(github.event.issue.labels.*.name, '/describe') # https://docs.github.com/ja/webhooks/webhook-events-and-payloads#issues
runs-on: ubuntu-22.04 # https://docs.github.com/ja/actions/using-jobs/choosing-the-runner-for-a-job
permissions:
issues: write
contents: read
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Download and Install PR Guardian
run: |
curl -sLJO -H 'Accept: application/octet-stream' \
"https://${{ secrets.GITHUB_TOKEN }}0@api.github.com/repos/pacificbelt30/alert-menta/releases/assets/$( \
curl -sL "https://${{ secrets.GITHUB_TOKEN }}@api.github.com/repos/pacificbelt30/alert-menta/releases/tags/v0.0.5" \
| jq '.assets[] | select(.name | contains("Linux_x86")) | .id')"
tar -zxvf alert-menta_Linux_x86_64.tar.gz
- run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}" >> $GITHUB_ENV
- name: Add Comment
run: |
./alert-menta -owner ${{ github.repository_owner }} -issue ${{ github.event.issue.number }} -repo ${{ env.REPOSITORY_NAME }} -token ${{ secrets.GITHUB_TOKEN }} -comment "Body: $BODY"
env: # https://docs.github.com/ja/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow
BODY: >
This is test issue.
repository ${{ env.REPOSITORY_NAME }}
runner.os ${{ runner.os }}
title ${{ github.event.issue.title }}
body ${{ github.event.issue.body }}

0 comments on commit 47055d3

Please sign in to comment.