-
Notifications
You must be signed in to change notification settings - Fork 33
32 lines (32 loc) · 949 Bytes
/
test-action.yml
File metadata and controls
32 lines (32 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Test action
on: pull_request
jobs:
test:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Setup # テストの準備
run: date > foo.md
- name: Exercise # テスト対象コードの実行
id: exercise
uses: ./
with:
message: Test
- name: Verify # 実行結果の検証
run: |
set -x
test "$(gh pr view "${BRANCH}" --json title --jq .title)" = "Test"
env:
BRANCH: ${{ steps.exercise.outputs.branch }}
- name: Teardown # テストの後始末
if: ${{ always() }}
run: |
gh pr close "${BRANCH}" || true
git push origin "${BRANCH}" --delete || true
env:
BRANCH: ${{ steps.exercise.outputs.branch }}