From 8139d6003e0e216735fdb7522e85803c851b2989 Mon Sep 17 00:00:00 2001 From: xavidop Date: Sun, 22 Oct 2023 14:56:52 +0200 Subject: [PATCH 1/4] feat: added README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 8d20cac..53b061f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ # dialogflow-cx-messenger-ts Typescript classes to use Dialogflow Messenger Types in Typescript + +To install: +```bash +npm install dialogflow-cx-messenger-ts +``` +or +```bash +yarn add dialogflow-cx-messenger-ts +``` \ No newline at end of file From ae429227e371e4a25c3ca82a92d5a7d7b99a82ba Mon Sep 17 00:00:00 2001 From: xavidop Date: Sun, 22 Oct 2023 15:04:10 +0200 Subject: [PATCH 2/4] feat: workflows --- .github/workflows/build.yaml | 33 +++++++++++++++++++++++++++++++ .github/workflows/codeql.yml | 26 ++++++++++++++++++++++++ .github/workflows/depsreview.yaml | 14 +++++++++++++ .github/workflows/lint.yaml | 33 +++++++++++++++++++++++++++++++ .github/workflows/release.yml | 9 ++++----- 5 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/depsreview.yaml create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..3b510bc --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,33 @@ +name: yarn-build +on: + push: + tags: + - v* + branches: + - master + pull_request: +permissions: + contents: read + +jobs: + yarnci: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: read # for actions/github-script to get PR info + name: lint + runs-on: ubuntu-latest + steps: + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + cache: yarn + node-version: lts/* + - uses: actions/checkout@v4 + - name: install + uses: borales/actions-yarn@v4 + with: + cmd: install --frozen-lockfile + - name: build + uses: borales/actions-yarn@v4 + with: + cmd: build \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..6fbceaa --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,26 @@ +name: "codeql" + +on: + push: + branches: [ master ] + +jobs: + analyze: + name: analyze + runs-on: ubuntu-latest + + permissions: + security-events: write + actions: read + contents: read + + steps: + - uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + cache: yarn + node-version: lts/* + - uses: github/codeql-action/init@v2 + - uses: github/codeql-action/autobuild@v2 + - uses: github/codeql-action/analyze@v2 \ No newline at end of file diff --git a/.github/workflows/depsreview.yaml b/.github/workflows/depsreview.yaml new file mode 100644 index 0000000..8142e00 --- /dev/null +++ b/.github/workflows/depsreview.yaml @@ -0,0 +1,14 @@ +name: dependency-review +on: [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 # v3 + - uses: actions/dependency-review-action@v3 + with: + allow-licenses: BSD-2-Clause, BSD-3-Clause, MIT, Apache-2.0, MPL-2.0 \ No newline at end of file diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..8b001c6 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,33 @@ +name: yarnci-lint +on: + push: + tags: + - v* + branches: + - master + pull_request: +permissions: + contents: read + +jobs: + yarnci: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: read # for yarnci/yarnci-lint-action to fetch pull requests + name: lint + runs-on: ubuntu-latest + steps: + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + cache: yarn + node-version: lts/* + - uses: actions/checkout@v4 + - name: install + uses: borales/actions-yarn@v4 + with: + cmd: install --frozen-lockfile + - name: lint + uses: borales/actions-yarn@v4 + with: + cmd: lint \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d645e8..1b867c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,13 +18,12 @@ jobs: name: release runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 with: - cache: npm + cache: yarn node-version: lts/* - - run: npm clean-install - - run: npm audit signatures + - run: yarn build # pinned version updated automatically by Renovate. # details at https://semantic-release.gitbook.io/semantic-release/usage/installation#global-installation - run: npx semantic-release@21.0.2 From e590636aeceffce20b2bf65c564090a431901439 Mon Sep 17 00:00:00 2001 From: xavidop Date: Sun, 22 Oct 2023 15:06:06 +0200 Subject: [PATCH 3/4] feat: yarn --- .github/workflows/build.yaml | 2 +- .github/workflows/lint.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3b510bc..04e2d66 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -17,12 +17,12 @@ jobs: name: lint runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v3 with: cache: yarn node-version: lts/* - - uses: actions/checkout@v4 - name: install uses: borales/actions-yarn@v4 with: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 8b001c6..d5cce13 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -17,12 +17,12 @@ jobs: name: lint runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v3 with: cache: yarn node-version: lts/* - - uses: actions/checkout@v4 - name: install uses: borales/actions-yarn@v4 with: From d9db4b2b568c34ccbe98659181a6120b8162defb Mon Sep 17 00:00:00 2001 From: xavidop Date: Sun, 22 Oct 2023 15:07:27 +0200 Subject: [PATCH 4/4] feat: added milestone --- .github/workflows/milestone.yaml | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/milestone.yaml diff --git a/.github/workflows/milestone.yaml b/.github/workflows/milestone.yaml new file mode 100644 index 0000000..f6ed0c6 --- /dev/null +++ b/.github/workflows/milestone.yaml @@ -0,0 +1,58 @@ +# shamelessly copied from https://github.com/sigstore/cosign/blob/main/.github/workflows/milestone.yaml + +name: milestone + +on: + pull_request_target: + types: [closed] + branches: + - master + +jobs: + milestone: + runs-on: ubuntu-latest + + permissions: + actions: none + checks: none + contents: read + deployments: none + issues: write + packages: none + pull-requests: write + repository-projects: none + security-events: none + statuses: none + + steps: + - uses: actions/github-script@v6 + with: + script: | + if (!context.payload.pull_request.merged) { + console.log('PR was not merged, skipping.'); + return; + } + + if (!!context.payload.pull_request.milestone) { + console.log('PR has existing milestone, skipping.'); + return; + } + + milestones = await github.rest.issues.listMilestones({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + sort: 'due_on', + direction: 'asc' + }) + if (milestones.data.length === 0) { + console.log('There are no milestones, skipping.'); + return; + } + + await github.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + milestone: milestones.data[0].number + }); \ No newline at end of file