diff --git a/.github/workflows/issue-comment.yaml b/.github/workflows/issue-comment.yaml new file mode 100644 index 000000000..4b04aa860 --- /dev/null +++ b/.github/workflows/issue-comment.yaml @@ -0,0 +1,17 @@ +name: issue-comment-workflow +on: issue_comment + +jobs: + pr-comment: + if: ${{ github.event.issue.pull_request }} + runs-on: ubuntu-latest + steps: + - name: pr comment + run: echo ${{ github.event.issue.pull_request }} + + issue-comment: + if: ${{ !github.event.issue.pull_request }} + runs-on: ubuntu-latest + steps: + - name: issue comment + run: echo ${{ github.event.issue.pull_request }} diff --git a/.github/workflows/multiple_event.yaml b/.github/workflows/multiple_event.yaml new file mode 100644 index 000000000..2205d9426 --- /dev/null +++ b/.github/workflows/multiple_event.yaml @@ -0,0 +1,36 @@ +name: multiple-event-workflow +on: + push: + issues: + types: [opened] + workflow_dispatch: + inputs: + name: + description: "set name" + required: true + default: "github-actions" + type: string + environment: + description: "set env" + required: true + default: "dev" + type: choice + options: + - dev + - qa + - prod + +jobs: + multiple-event-job: + runs-on: ubuntu-latest + steps: + - name: step1 + run: echo hello world + - name: step2 + run: | + echo hello world + echo github action + - name: echo inputs + run: | + echo ${{ inputs.name }} + echo ${{ inputs.environment }} diff --git a/.github/workflows/part1/issue.yaml b/.github/workflows/part1/issue.yaml new file mode 100644 index 000000000..66dea76b8 --- /dev/null +++ b/.github/workflows/part1/issue.yaml @@ -0,0 +1,15 @@ +name: issue-workflow +on: + issues: + types: [opened] + +jobs: + issue-job: + runs-on: ubuntu-latest + steps: + - name: step1 + run: echo hello world + - name: step2 + run: | + echo hello world + echo github action diff --git a/.github/workflows/part1/pull_request.yaml b/.github/workflows/part1/pull_request.yaml new file mode 100644 index 000000000..763010f66 --- /dev/null +++ b/.github/workflows/part1/pull_request.yaml @@ -0,0 +1,15 @@ +name: pull-request-workflow +on: + pull_request: + types: [opened] + +jobs: + pull-request-job: + runs-on: ubuntu-latest + steps: + - name: step1 + run: echo hello world + - name: step2 + run: | + echo hello world + echo github actions diff --git a/.github/workflows/part1/push.yaml b/.github/workflows/part1/push.yaml new file mode 100644 index 000000000..d4771cf4b --- /dev/null +++ b/.github/workflows/part1/push.yaml @@ -0,0 +1,13 @@ +name: push-workflow test test2 +on: push # push이벤트에 의해서 워크플로우를 트리거함 + +jobs: + push-job: + runs-on: ubuntu-latest + steps: + - name: step1 + run: echo hello world + - name: step2 + run: | + echo hello world + echo github actions diff --git a/.github/workflows/workflow-dispatch.yaml b/.github/workflows/workflow-dispatch.yaml new file mode 100644 index 000000000..18159d497 --- /dev/null +++ b/.github/workflows/workflow-dispatch.yaml @@ -0,0 +1,33 @@ +name: workflow-dispatch +on: + workflow_dispatch: + inputs: + name: + description: "set name" + required: true + default: "github-actions" + type: string + environment: + description: "set env" + required: true + default: "dev" + type: choice + options: + - dev + - qa + - prod + +jobs: + workflow-dispatch-job: + runs-on: ubuntu-latest + steps: + - name: step1 + run: echo hello world + - name: step2 + run: | + echo hello world + echo github action + - name: echo inputs + run: | + echo ${{ inputs.name }} + echo ${{ inputs.environment }}