From 161093d8610f9fb47ed1ee253aa3c4e2e9581e61 Mon Sep 17 00:00:00 2001 From: IvanZosimov Date: Thu, 8 Dec 2022 13:27:13 +0100 Subject: [PATCH] Update the repo to the standards of maintaining team In scope of this commit issues and PR temlates were updated, some workflows were renamed and partly updated, some workflows such as release-new-action-version.yml and licensed.yml were added. The stale.yml workflow was deleted as it was considered as harmful and inconvenient. --- .github/ISSUE_TEMPLATE/bug_report.md | 35 ++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/ISSUE_TEMPLATE/feature-request.md | 16 +++++-- .github/ISSUE_TEMPLATE/other_issue_report.md | 13 ----- .github/ISSUE_TEMPLATE/stale_issue_report.md | 28 ----------- .github/pull_request_template.md | 15 +++--- .github/workflows/build-test.yml | 47 +++++++++++++++++++ .github/workflows/codeql.yml | 8 ++-- .../workflows/{licensed.off => licensed.yml} | 17 ++++--- .../workflows/release-new-action-version.yml | 28 +++++++++++ .github/workflows/stale.yml | 19 -------- .github/workflows/test.yml | 28 ----------- 12 files changed, 146 insertions(+), 110 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/other_issue_report.md delete mode 100644 .github/ISSUE_TEMPLATE/stale_issue_report.md create mode 100644 .github/workflows/build-test.yml rename .github/workflows/{licensed.off => licensed.yml} (55%) create mode 100644 .github/workflows/release-new-action-version.yml delete mode 100644 .github/workflows/stale.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..5b6c5465 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a bug report +title: '' +labels: bug, needs triage +assignees: '' + +--- + + + + +**Description:** +A clear and concise description of what the bug is. + +**Action version:** +Specify the task version + +**Platform:** +- [ ] Ubuntu +- [ ] macOS +- [ ] Windows + +**Runner type:** +- [ ] Hosted +- [ ] Self-hosted + +**Repro steps:** +A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link. + +**Expected behavior:** +A description of what you expected to happen. + +**Actual behavior:** +A description of what is actually happening. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 3ba13e0c..ec4bb386 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1 @@ -blank_issues_enabled: false +blank_issues_enabled: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index b8c9c0ed..a5460227 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -1,11 +1,19 @@ --- name: Feature request -about: Propose a new feature or an enhancement +about: Suggest an idea for this project title: '' -labels: enhancement +labels: feature request, needs triage assignees: '' --- -## The problem + + -## The solution +**Description:** +Describe your proposal. + +**Justification:** +Justification or a use case for your proposal. + +**Are you willing to submit a PR?** + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/other_issue_report.md b/.github/ISSUE_TEMPLATE/other_issue_report.md deleted file mode 100644 index 01c37238..00000000 --- a/.github/ISSUE_TEMPLATE/other_issue_report.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -name: Other issue report -about: Report other issue -title: '' -labels: bug -assignees: '' ---- - -## Describe your issue - -## Further context - - diff --git a/.github/ISSUE_TEMPLATE/stale_issue_report.md b/.github/ISSUE_TEMPLATE/stale_issue_report.md deleted file mode 100644 index 3a64cb86..00000000 --- a/.github/ISSUE_TEMPLATE/stale_issue_report.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Stale issue report -about: Report issues with using the stale action -title: '' -labels: bug -assignees: '' ---- - - - -## Describe your issue - -## Your stale action configuration - - - -```yml -jobs: - stale: - runs-on: ... - steps: - - uses: actions/stale@... - with: ... -``` - -## Further context - - diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e778b254..52e6557e 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,10 +1,9 @@ - +**Description:** +Describe your changes. -## Changes +**Related issue:** +Add link to the related issue. -- [x] ... - -## Context - - - +**Check list:** +- [ ] Mark if documentation changes are required. +- [ ] Mark if tests were added or updated to cover the changes. diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 00000000..f317ce66 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,47 @@ +name: Build & Test +on: + pull_request: + paths-ignore: + - '**.md' + push: + branches: + - main + - releases/* + paths-ignore: + - '**.md' + +jobs: + build: + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-latest, windows-latest, macOS-latest] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set Node.js 16 + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: npm + + - name: Install dependencies + run: npm ci --ignore-scripts + + - name: Format, lint, build and test + run: npm run all:ci + + dry-run-test: # make sure the action works on a clean machine without building + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./ + id: stale + with: + stale-issue-message: 'This issue is stale' + stale-pr-message: 'This PR is stale' + debug-only: true + - name: Print outputs + run: echo ${{ join(steps.stale.outputs.*, ',') }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6b76f3fe..42018285 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,11 +2,11 @@ name: 'Code scanning' on: push: - branches: - - main + branches: [ main ] pull_request: + branches: [ main ] schedule: - - cron: '0 19 * * 0' + - cron: '23 19 * * 0' jobs: CodeQL-Build: @@ -17,6 +17,8 @@ jobs: - name: Initialize CodeQL uses: github/codeql-action/init@v2 + with: + languages: "javascript" - name: Autobuild uses: github/codeql-action/autobuild@v2 diff --git a/.github/workflows/licensed.off b/.github/workflows/licensed.yml similarity index 55% rename from .github/workflows/licensed.off rename to .github/workflows/licensed.yml index 512ee0d9..867af6e9 100644 --- a/.github/workflows/licensed.off +++ b/.github/workflows/licensed.yml @@ -1,20 +1,25 @@ name: Licensed on: - push: {branches: main} - pull_request: {branches: main} + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: jobs: test: runs-on: ubuntu-latest name: Check licenses steps: - - uses: actions/checkout@v2 - - run: npm ci + - uses: actions/checkout@v3 + - run: npm ci --ignore-scripts - name: Install licensed run: | cd $RUNNER_TEMP - curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/2.12.2/licensed-2.12.2-linux-x64.tar.gz + curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.9.0/licensed-3.9.0-linux-x64.tar.gz sudo tar -xzf licensed.tar.gz sudo mv licensed /usr/local/bin/licensed - - run: licensed status + - run: licensed status \ No newline at end of file diff --git a/.github/workflows/release-new-action-version.yml b/.github/workflows/release-new-action-version.yml new file mode 100644 index 00000000..c5c4bdfc --- /dev/null +++ b/.github/workflows/release-new-action-version.yml @@ -0,0 +1,28 @@ +name: Release new action version +on: + release: + types: [released] + workflow_dispatch: + inputs: + TAG_NAME: + description: 'Tag name that the major tag will point to' + required: true + +env: + TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} +permissions: + contents: write + +jobs: + update_tag: + name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes + environment: + name: releaseNewActionVersion + runs-on: ubuntu-latest + steps: + - name: Update the ${{ env.TAG_NAME }} tag + id: update-major-tag + uses: actions/publish-action@v0.2.1 + with: + source-tag: ${{ env.TAG_NAME }} + slack-webhook: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index a6f78c1d..00000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Stale issue handler' -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@main - id: stale - with: - stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days' - days-before-stale: 30 - days-before-close: 5 - exempt-issue-labels: 'blocked,must,should,keep' - - name: Print outputs - run: echo ${{ join(steps.stale.outputs.*, ',') }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 6a6ccd55..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: 'Build' -on: # rebuild any PRs and main branch changes - pull_request: - push: - branches: - - main - - 'releases/*' - -jobs: - build: # make sure build/ci work properly - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: | - npm ci - npm run all:ci - test: # make sure the action works on a clean machine without building - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ./ - id: stale - with: - stale-issue-message: 'This issue is stale' - stale-pr-message: 'This PR is stale' - debug-only: true - - name: Print outputs - run: echo ${{ join(steps.stale.outputs.*, ',') }}