From 6dbbc00a48f02d703c585fe49f73a168d87b5357 Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Mon, 1 Apr 2024 09:52:08 -0700 Subject: [PATCH 1/4] ci: Update job to check for file existence to force compliance with GitHub's Community Standards. --- .github/workflows/tek-repo-lint.yml | 116 ++++++---------------------- 1 file changed, 23 insertions(+), 93 deletions(-) diff --git a/.github/workflows/tek-repo-lint.yml b/.github/workflows/tek-repo-lint.yml index 6f5b4e10..a83763ad 100644 --- a/.github/workflows/tek-repo-lint.yml +++ b/.github/workflows/tek-repo-lint.yml @@ -8,105 +8,35 @@ on: workflow_dispatch: # IMPORTANT: Any new jobs need to be added to the check-repo-lint-passed job to ensure they correctly gate code changes jobs: - check-for-codeowners-file: + enforce-community-standards: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + filename: + - .github/CODEOWNERS + - README.@(md|rst) + - CODE_OF_CONDUCT.@(md|rst) + - CONTRIBUTING.@(md|rst) + - LICENSE.@(md|rst) + - SECURITY.@(md|rst) + - .github/ISSUE_TEMPLATE/bug_report.yml + - .github/ISSUE_TEMPLATE/feature_request.yml + - .github/PULL_REQUEST_TEMPLATE.md + - .github/dependabot.yml + - .github/workflows/codeql-analysis.yml steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Check for CODEOWNERS - id: codeowners_file - uses: initialstate/file-check-action@v1 + - name: Ensure ${{ matrix.filename }} exists + uses: andstor/file-existence-action@v3 with: - file: .github/CODEOWNERS - - name: CODEOWNERS file Output Test - run: echo ${{ steps.codeowners_file.outputs.file_exists }} - - name: CODEOWNERS file exists with content - if: steps.codeowners_file.outputs.file_exists == 'true' - run: echo CODEOWNERS file exists! - - name: CODEOWNERS file does not exist - if: steps.codeowners_file.outputs.file_exists == 'false' - run: echo CODEOWNERS file does not exist! - check-for-readme-file: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Check for README - id: readme_file - uses: initialstate/file-check-action@v1 - with: - file: README - - name: README file Output Test - run: echo ${{ steps.readme_file.outputs.file_exists }} - - name: README file exists with content - if: steps.readme_file.outputs.file_exists == 'true' - run: echo README file exists! - - name: README file does not exist - if: steps.readme_file.outputs.file_exists == 'false' - run: echo README file does not exist! - check-for-license: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Check for LICENSE - id: license_file - uses: initialstate/file-check-action@v1 - with: - file: LICENSE - - name: LICENSE file Output Test - run: echo ${{ steps.license_file.outputs.file_exists }} - - name: LICENSE file exists with content - if: steps.license_file.outputs.file_exists == 'true' - run: echo LICENSE file exists! - - name: LICENSE file does not exist - if: steps.license_file.outputs.file_exists == 'false' - run: echo LICENSE file does not exist! - check-for-dependabot-file: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Check for dependabot.yml - id: dependabot_file - uses: initialstate/file-check-action@v1 - with: - file: .github/dependabot.yml - - name: dependabot.yml file Output Test - run: echo ${{ steps.dependabot_file.outputs.file_exists }} - - name: dependabot file exists with content - if: steps.dependabot_file.outputs.file_exists == 'true' - run: echo dependabot file exists! - - name: dependabot file does not exist - if: steps.dependabot_file.outputs.file_exists == 'false' - run: echo dependabot file does not exist! - check-for-codeql-file: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Check for codeql-analysis.yml - id: codeql-analysis_file - uses: initialstate/file-check-action@v1 - with: - file: .github/workflows/codeql-analysis.yml - - name: codeql-analysis.yml file Output Test - run: echo ${{ steps.codeql-analysis_file.outputs.file_exists }} - - name: codeql-analysis file exists with content - if: steps.codeql-analysis_file.outputs.file_exists == 'true' - run: echo codeql-analysis file exists! - - name: codeql-analysis file does not exist - if: steps.codeql-analysis_file.outputs.file_exists == 'false' - run: echo codeql-analysis file does not exist! + files: ${{ matrix.filename }} + ignore_case: false + follow_symbolic_links: false + fail: true # Set the step to fail if the file doesn't exist # Check that all jobs passed check-repo-lint-passed: if: ${{ !cancelled() }} - needs: - - check-for-codeowners-file - - check-for-readme-file - - check-for-license - - check-for-dependabot-file - - check-for-codeql-file + needs: [enforce-community-standards] runs-on: ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed From 868821a32295832151b2d2f7f6e268851cfeedd6 Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Mon, 1 Apr 2024 09:52:59 -0700 Subject: [PATCH 2/4] test: Delete security file to test workflow change. --- SECURITY.md | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 684ea158..00000000 --- a/SECURITY.md +++ /dev/null @@ -1,12 +0,0 @@ -# Security Policy - -## Supported Versions - -| Version | Supported | -| ------- | ------------------ | -| > 0.1.0 | :white_check_mark: | - -## Reporting a Vulnerability - -Please reach out directly to the maintainers at tmdevicessupport@tektronix.com to report a -potential vulnerability. **Do not file a public issue.** From 095aea3bde4c5ec418d8edda76b913343f38ab70 Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Mon, 1 Apr 2024 09:55:16 -0700 Subject: [PATCH 3/4] ci: Checkout code before looking for files. --- .github/workflows/tek-repo-lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tek-repo-lint.yml b/.github/workflows/tek-repo-lint.yml index a83763ad..b377c2f2 100644 --- a/.github/workflows/tek-repo-lint.yml +++ b/.github/workflows/tek-repo-lint.yml @@ -26,6 +26,7 @@ jobs: - .github/dependabot.yml - .github/workflows/codeql-analysis.yml steps: + - uses: actions/checkout@v4 - name: Ensure ${{ matrix.filename }} exists uses: andstor/file-existence-action@v3 with: From 9b56224a5adf4dd67180985968e77427d6a621b6 Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Mon, 1 Apr 2024 09:57:21 -0700 Subject: [PATCH 4/4] test: Add back security file. --- SECURITY.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..684ea158 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,12 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| > 0.1.0 | :white_check_mark: | + +## Reporting a Vulnerability + +Please reach out directly to the maintainers at tmdevicessupport@tektronix.com to report a +potential vulnerability. **Do not file a public issue.**