Skip to content

Manual workflow Discord Windows #10

Manual workflow Discord Windows

Manual workflow Discord Windows #10

# This is a basic workflow that is manually triggered
name: Manual workflow Discord Windows
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# schedule:
# - cron: "10 * * * *"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "greet"
greet:
# The type of runner that the job will run on
# ジョブを、仮想マシン上で行う.
# runs-on: ubuntu-latest
# ジョブを、セルフホステッドランナー(自分で用意したPC)で実行する.
runs-on: self-hosted
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# 終了後に discordのwebhookで通知を行う
- name: pwdcheck
run: |
pwd
- name: command001
run: |
.\command001.ps1
- name: EchoWebhook
run: |
echo ${{ secrets.DISCORD_WEBHOOK_URL }}
- name: Notify Discord
# cmd.exe /c 'curl -H "Content-Type: application/json" -X POST -d "{\"username\": \"ここに名前を入れる\", \"content\": \"メッセージを送る!\"}" https://discord.com/api/webhooks/1294410759958298665/NsinS1PTNjGS8J8GFl_m37V36xB-1GzZNSfnoaTEF_LnwnUIqWqoMcWA_Gv3L15iFcxL'
# Invoke-WebRequest -Headers @{"Content-Type"="application/json"} -Method Post -Body "{`"username`": `"namename`", `"content`": `"messagemessage`"}" https://discord.com/api/webhooks/1294410759958298665/NsinS1PTNjGS8J8GFl_m37V36xB-1GzZNSfnoaTEF_LnwnUIqWqoMcWA_Gv3L15iFcxL
run: |
Invoke-WebRequest -Headers @{"Content-Type"="application/json"} -Method Post -Body "{`"username`": `"namename`", `"content`": `"messagemessage`"}" ${{ secrets.DISCORD_WEBHOOK_URL }}