From cc833c5cfd9c6184cbed4afe7d2e9b9a5cfac714 Mon Sep 17 00:00:00 2001 From: Hayden Faulds Date: Wed, 24 Jun 2020 14:46:53 +0100 Subject: [PATCH] use local action --- .github/workflows/ci.yml | 19 ------------ .github/workflows/integration.yml | 17 ----------- .github/workflows/pull-request-test.yml | 39 ------------------------- .github/workflows/test.yml | 18 ++++++++++++ 4 files changed, 18 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/integration.yml delete mode 100644 .github/workflows/pull-request-test.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 97bf12343..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,19 +0,0 @@ -on: - push: {branches: master} - pull_request: {branches: master} - -jobs: - ci: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: {node-version: 13.x} - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}} - restore-keys: ${{runner.os}}-npm- - - run: npm ci - - run: npm run style:check - - run: npm test diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index b43f4e766..000000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,17 +0,0 @@ -on: - push: {branches: master} - -jobs: - integration: - runs-on: ubuntu-latest - steps: - - id: output-set - uses: actions/github-script@master - with: - script: return core.getInput('input-value') - result-encoding: string - input-value: output - - run: | - if [[ "${{steps.output-set.outputs.result}}" != "output" ]]; then - exit 1 - fi diff --git a/.github/workflows/pull-request-test.yml b/.github/workflows/pull-request-test.yml deleted file mode 100644 index 7d3df4176..000000000 --- a/.github/workflows/pull-request-test.yml +++ /dev/null @@ -1,39 +0,0 @@ -on: - pull_request: - branches: master - types: [opened, synchronize] - -jobs: - pull-request-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ./ - with: - script: | - // Get the existing comments. - const {data: comments} = await github.issues.listComments({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.number, - }) - - // Find any comment already made by the bot. - const botComment = comments.find(comment => comment.user.id === 41898282) - const commentBody = "Hello from actions/github-script! (${{ github.sha }})" - - if (botComment) { - await github.issues.updateComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: botComment.id, - body: commentBody - }) - } else { - await github.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.number, - body: commentBody - }) - } diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..b9174ba71 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +on: + issues: + types: [opened] + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - uses: ./ + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '👋 Thanks for reporting!' + })