From 354d47329ace8ea54882b6835b007c0100dc8fba Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 23 Sep 2022 12:28:10 +0900 Subject: [PATCH] ci: add testdata --- .github/workflows/test.yaml | 79 ------------------------------------ testdata/release/normal.yaml | 23 +++++++++++ 2 files changed, 23 insertions(+), 79 deletions(-) create mode 100644 testdata/release/normal.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e74b253..5c13d17 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -40,82 +40,3 @@ jobs: with: data: ${{toJSON(fromJSON(env.DATA).data)}} - run: go run ./cmd/tester "$FILE" - - # test-push: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - uses: ./ - # with: - # data: | - # { - # "event_name": "push", - # "event": { - # "ref": "refs/heads/renovate/github.com-aws-aws-sdk-go-1.x", - # "sender": { - # "login": "suzuki-shunsuke" - # }, - # "head_commit": { - # "id": "a705bd6d8bc3882c983477cb3f20ab74ef8c24c2" - # }, - # "repository": { - # "full_name": "gha-trigger/gha-trigger", - # "name": "gha-trigger", - # "owner": { - # "login": "gha-trigger" - # } - # } - # } - # } - # test-release: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - uses: ./ - # with: - # data: | - # { - # "event_name": "release", - # "event": { - # "sender": { - # "login": "suzuki-shunsuke" - # }, - # "release": { - # "tag_name": "v0.1.0" - # }, - # "repository": { - # "full_name": "gha-trigger/gha-trigger", - # "name": "gha-trigger", - # "owner": { - # "login": "gha-trigger" - # } - # } - # } - # } - # - name: Test GHA_ACTOR - # run: | - # [ "$GHA_ACTOR" = suzuki-shunsuke ] - # - name: Test GHA_EVENT_NAME - # run: | - # [ "$GHA_EVENT_NAME" = release ] - # - name: Test GHA_REPOSITORY - # run: | - # [ "$GHA_REPOSITORY" = gha-trigger/gha-trigger ] - # - name: Test GHA_REPOSITORY_OWNER - # run: | - # [ "$GHA_REPOSITORY_OWNER" = gha-trigger ] - # - name: Test GHA_REPOSITORY_NAME - # run: | - # [ "$GHA_REPOSITORY_NAME" = gha-trigger ] - # - name: Test GHA_SHA - # run: | - # [ "$GHA_SHA" = "" ] - # - name: Test GHA_REF - # run: | - # [ "$GHA_REF" = v0.1.0 ] - # - name: Test GHA_REF_NAME - # run: | - # [ "$GHA_REF_NAME" = v0.1.0 ] - # - name: Test GHA_ENV - # run: | - # [ -n "$GHA_ENV" ] diff --git a/testdata/release/normal.yaml b/testdata/release/normal.yaml new file mode 100644 index 0000000..9f33075 --- /dev/null +++ b/testdata/release/normal.yaml @@ -0,0 +1,23 @@ +envs: + GHA_ACTOR: suzuki-shunsuke + GHA_EVENT_NAME: release + GHA_REPOSITORY: gha-trigger/gha-trigger + GHA_REPOSITORY_OWNER: gha-trigger + GHA_REPOSITORY_NAME: gha-trigger + GHA_SHA: + GHA_COMMIT_STATUS_SHA: + GHA_REF: v0.1.0 + GHA_REF_NAME: v0.1.0 + +data: + event_name: release + event: + sender: + login: suzuki-shunsuke + release: + tag_name: v0.1.0 + repository: + full_name: gha-trigger/gha-trigger + name: gha-trigger + owner: + login: gha-trigger