Skip to content

Instantly share code, notes, and snippets.

@JJ
Created December 5, 2019 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JJ/3398f604beca119e8f8d23d8abbd35ed to your computer and use it in GitHub Desktop.
Save JJ/3398f604beca119e8f8d23d8abbd35ed to your computer and use it in GitHub Desktop.
GitHub action that uses Perl in Windows with Powershell. This creates a comment when certain words are mentioned in an issue.
name: "We 🎔 Perl"
on:
issues:
types: [opened, edited, milestoned]
jobs:
seasonal_greetings:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2-beta
- name: Maybe greet
id: maybe-greet
env:
HEY: "Hey you!"
GREETING: "Merry Xmas to you too!"
BODY: ${{ github.event.issue.body }}
TOKEN: ${{ secrets.GITHUB_TOKEN}}
ISSUE: ${{ github.event.issue.number }}
run: |
$output=(perl utils/printenv.pl)
$body= @{ 'body'= $output } | ConvertTo-Json
$header= @{
'Authorization'="token $ENV:TOKEN"
}
Invoke-RestMethod -Uri "https://api.github.com/repos/JJ/raku-advent-calendar-article-2019/issues/$ENV:ISSUE/comments" -Method 'Post' -Body $body -Headers $header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment