Back to home
Search contents

Q. Github Workflowsが落ちたらIssueを作らせたい

Published at
81 words
1min read

continue-on-error とプリインストールされている gh コマンドを使えば簡単に出来る。

name: Test
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
timeout-minutes: 8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test
id: test
run: |
exit 1
continue-on-error: true
- name: Create issue
run: |
gh issue create --assignee "hrdtbs" --title "Issue report" --body "" --repo $GITHUB_REPOSITORY
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: steps.test.outcome == 'failure'