From ac55de2df1146a5b8243c61a32212526d859c818 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 12:27:22 -0700 Subject: [PATCH 01/53] Create super-linter.yaml --- .github/workflows/super-linter.yaml | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/super-linter.yaml diff --git a/.github/workflows/super-linter.yaml b/.github/workflows/super-linter.yaml new file mode 100644 index 0000000..f329979 --- /dev/null +++ b/.github/workflows/super-linter.yaml @@ -0,0 +1,58 @@ +--- +################################# +################################# +## Super Linter GitHub Actions ## +################################# +################################# +name: Lint Code Base + +############################# +# Start the job on all push # +############################# +on: + push: + branches-ignore: main + # Remove the line above to run when pushing to master or main + pull_request: + branches: main + +############### +# Set the Job # +############### +jobs: + build: + # Name the Job + name: Lint Code Base + # Set the agent to run on + runs-on: ubuntu-latest + + ############################################ + # Grant status permission for MULTI_STATUS # + ############################################ + permissions: + contents: read + packages: read + statuses: write + + ################## + # Load all steps # + ################## + steps: + ########################## + # Checkout the code base # + ########################## + - name: Checkout Code + uses: actions/checkout@v4 + with: + # Full git history is needed to get a proper + # list of changed files within `super-linter` + fetch-depth: 0 + + ################################ + # Run Linter against code base # + ################################ + - name: Lint Code Base + uses: super-linter/super-linter@v5 + env: + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 356f7fd1092f17e60cacf8cf97e3d2ba65db7800 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 12:38:05 -0700 Subject: [PATCH 02/53] use specific version of git --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fb819fb..f0ac1d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY requirements.txt *.py /action/workspace/ RUN python3 -m pip install --no-cache-dir -r requirements.txt \ && apt-get -y update \ - && apt-get -y install --no-install-recommends git \ + && apt-get -y install --no-install-recommends git=v2.42.0 \ && rm -rf /var/lib/apt/lists/* CMD ["/action/workspace/contributors.py"] From 3d8293db09dca3f1e853a48f692f83de8d67ddca Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 12:40:20 -0700 Subject: [PATCH 03/53] Use a single redirect. SC2129:style:4:1 --- .github/workflows/major-version-updater.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index 540271a..f22fe2d 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -18,9 +18,7 @@ jobs: tag=${GITHUB_REF/refs\/tags\//} version=${tag#v} major=${version%%.*} - echo "tag=${tag}" >> "$GITHUB_OUTPUT" - echo "version=${version}" >> "$GITHUB_OUTPUT" - echo "major=${major}" >> "$GITHUB_OUTPUT" + {echo "tag=${tag}"; echo "version=${version}"; echo "major=${major}"} >> "$GITHUB_OUTPUT" - name: force update major tag run: | From f5644c9b208751988a0c928f3adf11c56483e71e Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:22:15 -0700 Subject: [PATCH 04/53] Create .jscpd.json --- .github/linters/.jscpd.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/linters/.jscpd.json diff --git a/.github/linters/.jscpd.json b/.github/linters/.jscpd.json new file mode 100644 index 0000000..0c773a5 --- /dev/null +++ b/.github/linters/.jscpd.json @@ -0,0 +1,5 @@ +{ + "threshold": 0.1, + "ignore": ["test*"], + "absolute": true +} From 3b3a1a0b1286648cdd423c23ba43b3a89a81d85b Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:23:20 -0700 Subject: [PATCH 05/53] Add top level header --- .github/pull_request_template.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 02bea8a..62c7d95 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,4 @@ +# Pull Request ## Proposed Changes From 9820e7a130ce63a22aeda3adbc7a00ce70493c87 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:37:46 -0700 Subject: [PATCH 06/53] Create .markdown-lint.yml --- .github/linters/.markdown-lint.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/linters/.markdown-lint.yml diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 0000000..2942ce0 --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,21 @@ +--- +########################### +########################### +## Markdown Linter rules ## +########################### +########################### + +# Linter rules doc: +# - https://github.com/DavidAnson/markdownlint +# +# Note: +# To comment out a single error: +# +# any violations you want +# +# + +############### +# Rules by id # +############### +MD013: false # Line length From 4991ad01518affe5d575148acf9d5adddf418dba Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:39:39 -0700 Subject: [PATCH 07/53] Update .markdown-lint.yml --- .github/linters/.markdown-lint.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml index 2942ce0..2cd983b 100644 --- a/.github/linters/.markdown-lint.yml +++ b/.github/linters/.markdown-lint.yml @@ -18,4 +18,9 @@ ############### # Rules by id # ############### -MD013: false # Line length +# line length +MD013: false +# singe h1 +MD025: false +# duplicate headers +MDO24: false From 5611ad7b34b448235bd9016b30aca3937e29de1f Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:43:02 -0700 Subject: [PATCH 08/53] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e68f471..5cf40bb 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Find out more in the [GitHub API documentation](https://docs.github.com/en/rest/ 1. Create a repository to host this GitHub Action or select an existing repository. 1. Select a best fit workflow file from the [examples below](#example-workflows). 1. Copy that example into your repository (from step 1) and into the proper directory for GitHub Actions: `.github/workflows/` directory with the file extension `.yml` (ie. `.github/workflows/contributors.yml`) -1. Edit the values (`ORGANIZATION`, `REPOSITORY`, `START_DATE`, `END_DATE`) from the sample workflow with your information. If no start and end date are supplied, the action will consider the entire repo history and be unable to determine if contributors are new or returning. If running on a whole organization then no repository is needed. If running the action on just one repository or a list of repositories, then no organization is needed. +1. Edit the values (`ORGANIZATION`, `REPOSITORY`, `START_DATE`, `END_DATE`) from the sample workflow with your information. If no start and end date are supplied, the action will consider the entire repository history and be unable to determine if contributors are new or returning. If running on a whole organization then no repository is needed. If running the action on just one repository or a list of repositories, then no organization is needed. 1. Also edit the value for `GH_ENTERPRISE_URL` if you are using a GitHub Server and not using github.com. For github.com users, don't put anything in here. 1. If you are running this action on an organization or repository other than the one where the workflow file is going to be, then update the value of `GH_TOKEN`. Do this by creating a [GitHub API token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) with permissions to read the repository/organization and write issues. Then take the value of the API token you just created, and [create a repository secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets) where the name of the secret is `GH_TOKEN` and the value of the secret the API token. Then finally update the workflow file to use that repository secret by changing `GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}` to `GH_TOKEN: ${{ secrets.GH_TOKEN }}`. The name of the secret can really be anything. It just needs to match between when you create the secret name and when you refer to it in the workflow file. 1. If you want the resulting issue with the output to appear in a different repository other than the one the workflow file runs in, update the line `token: ${{ secrets.GITHUB_TOKEN }}` with your own GitHub API token stored as a repository secret. This process is the same as described in the step above. More info on creating secrets can be found [here](https://docs.github.com/en/actions/security-guides/encrypted-secrets). @@ -105,7 +105,7 @@ jobs: assignees: ``` -## Example markdown output with `start_date` and `end_date` supplied +## Example Markdown output with `start_date` and `end_date` supplied # Contributors @@ -120,7 +120,7 @@ jobs: | --- | --- | --- | --- | | zkoppert | 143 | False | [super-linter/super-linter](https://github.com/super-linter/super-linter/commits?author=zkoppert&since=2021-01-01&until=2023-10-10) | -## Example markdown output with no dates supplied +## Example Markdown output with no dates supplied # Contributors @@ -138,7 +138,7 @@ jobs: 1. Make sure you have at least Python3.11 installed 1. Copy `.env-example` to `.env` -1. Fill out the `.env` file with a _token_ from a user that has access to the organization to scan (listed below). Tokens should have at least read:org access for organization scanning and read:repo for repository scanning. +1. Fill out the `.env` file with a _token_ from a user that has access to the organization to scan (listed below). Tokens should have at least read:org access for organization scanning and read:repository for repository scanning. 1. Fill out the `.env` file with the configuration parameters you want to use 1. `pip3 install -r requirements.txt` 1. Run `python3 ./contributors.py`, which will output everything in the terminal From e84eaf913f9b11d0dbad2440812aa1b5303fa468 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:45:24 -0700 Subject: [PATCH 09/53] Create .textlintrc --- .github/linters/.textlintrc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/linters/.textlintrc diff --git a/.github/linters/.textlintrc b/.github/linters/.textlintrc new file mode 100644 index 0000000..58e4ba9 --- /dev/null +++ b/.github/linters/.textlintrc @@ -0,0 +1,10 @@ +{ + "filters": { + "comments": true + }, + "rules": { + "terminology": { + "severity": "warning" + } + } +} From d455fe00d078cbaaaed0abf2dd5a1edc1990ce73 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:47:41 -0700 Subject: [PATCH 10/53] Create .flake8 --- .github/linters/.flake8 | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/linters/.flake8 diff --git a/.github/linters/.flake8 b/.github/linters/.flake8 new file mode 100644 index 0000000..73c76f2 --- /dev/null +++ b/.github/linters/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 150 From c24ea984b0666fd673561f27f4f98fc88f58f879 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:48:48 -0700 Subject: [PATCH 11/53] sort imports --- contributors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contributors.py b/contributors.py index 02ddc56..0084e07 100644 --- a/contributors.py +++ b/contributors.py @@ -2,9 +2,10 @@ """This file contains the main() and other functions needed to get contributor information from the organization or repository""" from typing import List -import env + import auth import contributor_stats +import env import markdown From 7cf2571fd869b442481ae7795166459fef318fe3 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:49:20 -0700 Subject: [PATCH 12/53] sort imports --- env.py | 1 + 1 file changed, 1 insertion(+) diff --git a/env.py b/env.py index 3127930..5ea3c54 100644 --- a/env.py +++ b/env.py @@ -2,6 +2,7 @@ import os from os.path import dirname, join + from dotenv import load_dotenv From 1bfa0038a0586b14df95351ff89327142d8fc800 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:49:35 -0700 Subject: [PATCH 13/53] sort imports --- test_auth.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test_auth.py b/test_auth.py index 3047e06..9c8786c 100644 --- a/test_auth.py +++ b/test_auth.py @@ -1,6 +1,7 @@ """Test cases for the auth module.""" import unittest from unittest.mock import patch + import auth From 5a8b00bf53504eb32c493c4d7d3b792db6e6004d Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:49:48 -0700 Subject: [PATCH 14/53] sort imports --- test_contributor_stats.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test_contributor_stats.py b/test_contributor_stats.py index 9175fa9..adcd0a5 100644 --- a/test_contributor_stats.py +++ b/test_contributor_stats.py @@ -1,6 +1,7 @@ """This module contains the tests for the ContributorStats class.""" import unittest + from contributor_stats import ContributorStats, is_new_contributor, merge_contributors From 244cc2c99d618d32ecdada1be0aa502412578d21 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:50:02 -0700 Subject: [PATCH 15/53] sort imports --- test_contributors.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test_contributors.py b/test_contributors.py index 59ec71f..68f8475 100644 --- a/test_contributors.py +++ b/test_contributors.py @@ -3,6 +3,7 @@ import unittest from unittest.mock import patch, MagicMock from contributor_stats import ContributorStats + from contributors import get_contributors, get_all_contributors From 7c058db28184cfcfa4b383885176a90dc96de6aa Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:50:20 -0700 Subject: [PATCH 16/53] sort imports --- test_env.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test_env.py b/test_env.py index b7fc8ef..2b2f450 100644 --- a/test_env.py +++ b/test_env.py @@ -2,6 +2,7 @@ import unittest from unittest.mock import patch + import env From b9307bf0a7db5d2e03b2d6bc49c3deae3b79c3fb Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:51:17 -0700 Subject: [PATCH 17/53] sort imports --- test_markdown.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test_markdown.py b/test_markdown.py index 5cdff42..95bccd1 100644 --- a/test_markdown.py +++ b/test_markdown.py @@ -1,8 +1,9 @@ """This is the test module for the markdown module""" import unittest -from unittest.mock import patch, mock_open -from markdown import write_to_markdown +from unittest.mock import mock_open, patch + import contributor_stats +from markdown import write_to_markdown class TestMarkdown(unittest.TestCase): From 6e9c54e20a97216762e26f93c1449563df26a627 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:53:58 -0700 Subject: [PATCH 18/53] Add type annotation --- contributor_stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributor_stats.py b/contributor_stats.py index 66220f2..04bf587 100644 --- a/contributor_stats.py +++ b/contributor_stats.py @@ -99,7 +99,7 @@ def merge_contributors(contributors: list) -> list: Returns: merged_contributors (list): A list of ContributorStats objects with no duplicate usernames """ - merged_contributors = [] + merged_contributors:List[ContributorStats] = [] for contributor_list in contributors: for contributor in contributor_list: # if the contributor is already in the merged list, merge their relavent attributes From 4a1d3ce98dcacf7a622aa0f4778b24d596552fd0 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:55:20 -0700 Subject: [PATCH 19/53] only use tolower() if it exists --- env.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/env.py b/env.py index 5ea3c54..7673594 100644 --- a/env.py +++ b/env.py @@ -54,7 +54,8 @@ def get_env_vars() -> tuple[str, str, str, str, str, str, str]: sponsor_info = os.getenv("SPONSOR_INFO") # make sure that sponsor_string is a boolean - sponsor_info = sponsor_info.lower().strip() + if sponsor_info: + sponsor_info = sponsor_info.lower().strip() if sponsor_info not in ["true", "false", ""]: raise ValueError( "SPONSOR_INFO environment variable not a boolean. ie. True or False or blank" From c7c559c30414c961a39faa95e7b90edf07ff9ed0 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 13:56:25 -0700 Subject: [PATCH 20/53] correct return type --- env.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env.py b/env.py index 7673594..6b68554 100644 --- a/env.py +++ b/env.py @@ -6,7 +6,7 @@ from dotenv import load_dotenv -def get_env_vars() -> tuple[str, str, str, str, str, str, str]: +def get_env_vars() -> tuple[str | None, list[str], str, str, str | None, str | None, str | Any]: """ Get the environment variables for use in the action. From 0726dd2d4269d0b9f25c89856d758f9034364831 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:28:28 -0700 Subject: [PATCH 21/53] Create .mypy.ini --- .github/linters/.mypy.ini | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/linters/.mypy.ini diff --git a/.github/linters/.mypy.ini b/.github/linters/.mypy.ini new file mode 100644 index 0000000..e314a85 --- /dev/null +++ b/.github/linters/.mypy.ini @@ -0,0 +1,4 @@ +# Global options: + +[mypy] +disable_error_code = attr-defined From 2127d5c6ecbc625829b5af7b68877428bf2860ac Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:31:43 -0700 Subject: [PATCH 22/53] fix indentation --- .github/workflows/contributors_report.yaml | 60 +++++++++++----------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/contributors_report.yaml b/.github/workflows/contributors_report.yaml index 05f9147..8106a9d 100644 --- a/.github/workflows/contributors_report.yaml +++ b/.github/workflows/contributors_report.yaml @@ -1,3 +1,4 @@ +--- name: Monthly contributor report on: workflow_dispatch: @@ -13,33 +14,32 @@ jobs: runs-on: ubuntu-latest steps: - - - name: Get dates for last month - shell: bash - run: | - # Calculate the first day of the previous month - start_date=$(date -d "last month" +%Y-%m-01) - - # Calculate the last day of the previous month - end_date=$(date -d "$start_date +1 month -1 day" +%Y-%m-%d) - - #Set an environment variable with the date range - echo "START_DATE=$start_date" >> "$GITHUB_ENV" - echo "END_DATE=$end_date" >> "$GITHUB_ENV" - - - name: Run contributor action - uses: github/contributors@v1 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - START_DATE: ${{ env.START_DATE }} - END_DATE: ${{ env.END_DATE }} - REPOSITORY: github/contributors - SPONSOR_INFO: "true" - - - name: Create issue - uses: peter-evans/create-issue-from-file@v4 - with: - title: Monthly contributor report - token: ${{ secrets.GITHUB_TOKEN }} - content-filepath: ./contributors.md - assignees: zkoppert + - name: Get dates for last month + shell: bash + run: | + # Calculate the first day of the previous month + start_date=$(date -d "last month" +%Y-%m-01) + + # Calculate the last day of the previous month + end_date=$(date -d "$start_date +1 month -1 day" +%Y-%m-%d) + + #Set an environment variable with the date range + echo "START_DATE=$start_date" >> "$GITHUB_ENV" + echo "END_DATE=$end_date" >> "$GITHUB_ENV" + + - name: Run contributor action + uses: github/contributors@v1 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + START_DATE: ${{ env.START_DATE }} + END_DATE: ${{ env.END_DATE }} + REPOSITORY: github/contributors + SPONSOR_INFO: "true" + + - name: Create issue + uses: peter-evans/create-issue-from-file@v4 + with: + title: Monthly contributor report + token: ${{ secrets.GITHUB_TOKEN }} + content-filepath: ./contributors.md + assignees: zkoppert From 565957799574aff01708f25bafe97fe04ec71a6d Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:32:38 -0700 Subject: [PATCH 23/53] Fix indentation in example workflow --- README.md | 59 +++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 5cf40bb..6d3c785 100644 --- a/README.md +++ b/README.md @@ -73,36 +73,35 @@ jobs: runs-on: ubuntu-latest steps: - - - name: Get dates for last month - shell: bash - run: | - # Calculate the first day of the previous month - start_date=$(date -d "last month" +%Y-%m-01) - - # Calculate the last day of the previous month - end_date=$(date -d "$start_date +1 month -1 day" +%Y-%m-%d) - - #Set an environment variable with the date range - echo "START_DATE=$start_date" >> "$GITHUB_ENV" - echo "END_DATE=$end_date" >> "$GITHUB_ENV" - - - name: Run contributor action - uses: github/contributors@v1 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - START_DATE: ${{ env.START_DATE }} - END_DATE: ${{ env.END_DATE }} - ORGANIZATION: - SPONSOR_INFO: "true" - - - name: Create issue - uses: peter-evans/create-issue-from-file@v4 - with: - title: Monthly contributor report - token: ${{ secrets.GITHUB_TOKEN }} - content-filepath: ./contributors.md - assignees: + - name: Get dates for last month + shell: bash + run: | + # Calculate the first day of the previous month + start_date=$(date -d "last month" +%Y-%m-01) + + # Calculate the last day of the previous month + end_date=$(date -d "$start_date +1 month -1 day" +%Y-%m-%d) + + #Set an environment variable with the date range + echo "START_DATE=$start_date" >> "$GITHUB_ENV" + echo "END_DATE=$end_date" >> "$GITHUB_ENV" + + - name: Run contributor action + uses: github/contributors@v1 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + START_DATE: ${{ env.START_DATE }} + END_DATE: ${{ env.END_DATE }} + ORGANIZATION: + SPONSOR_INFO: "true" + + - name: Create issue + uses: peter-evans/create-issue-from-file@v4 + with: + title: Monthly contributor report + token: ${{ secrets.GITHUB_TOKEN }} + content-filepath: ./contributors.md + assignees: ``` ## Example Markdown output with `start_date` and `end_date` supplied From ddd85897a5220c83546442e74153b54583e0b5e8 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:34:56 -0700 Subject: [PATCH 24/53] fix indentation and brackets --- .github/workflows/docker-ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-ci.yml b/.github/workflows/docker-ci.yml index 6d19a9f..14323bc 100644 --- a/.github/workflows/docker-ci.yml +++ b/.github/workflows/docker-ci.yml @@ -1,10 +1,11 @@ +--- name: Docker Image CI on: push: - branches: [ main ] + branches: main pull_request: - branches: [ main ] + branches: main jobs: @@ -13,6 +14,6 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build . --file Dockerfile --platform linux/amd64 + - uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build . --file Dockerfile --platform linux/amd64 From f01eb742d11f8b3eaecd5a1fdd6e0293f51fa676 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:35:31 -0700 Subject: [PATCH 25/53] fix brackets --- .github/workflows/major-version-updater.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index f22fe2d..5ca5f95 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -3,7 +3,7 @@ name: Major Version Updater # Whenever a new release is made, push a major version tag on: release: - types: [ published ] + types: published jobs: update-major-version-tag: From 916ab5dd594af8c6bc6418d5dd922f052d90ca3b Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:40:23 -0700 Subject: [PATCH 26/53] fix brackets --- .github/workflows/python-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 1a426a4..4228af9 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -1,3 +1,4 @@ +--- # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions @@ -5,9 +6,9 @@ name: Python package on: push: - branches: [ main ] + branches: main pull_request: - branches: [ main ] + branches: main jobs: build: From 6b16cbe39e93e4533bc31fbe18388666cb9e311d Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:40:52 -0700 Subject: [PATCH 27/53] Create .yaml-lint.yml --- .github/linters/.yaml-lint.yml | 59 ++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/linters/.yaml-lint.yml diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml new file mode 100644 index 0000000..955950d --- /dev/null +++ b/.github/linters/.yaml-lint.yml @@ -0,0 +1,59 @@ +--- +########################################### +# These are the rules used for # +# linting all the yaml files in the stack # +# NOTE: # +# You can disable line with: # +# # yamllint disable-line # +########################################### +rules: + braces: + level: warning + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: 1 + max-spaces-inside-empty: 5 + brackets: + level: warning + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: 1 + max-spaces-inside-empty: 5 + colons: + level: warning + max-spaces-before: 0 + max-spaces-after: 1 + commas: + level: warning + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + comments: disable + comments-indentation: disable + document-end: disable + document-start: + level: warning + present: true + empty-lines: + level: warning + max: 2 + max-start: 0 + max-end: 0 + hyphens: + level: warning + max-spaces-after: 1 + indentation: + level: warning + spaces: consistent + indent-sequences: true + check-multi-line-strings: false + key-duplicates: enable + line-length: + level: warning + max: 1024 + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + new-line-at-end-of-file: disable + new-lines: + type: unix + trailing-spaces: disable From 6aab8ac6b765a8bee87602d28fb0366e8e088d21 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:42:33 -0700 Subject: [PATCH 28/53] fix indentation --- .github/workflows/python-ci.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 4228af9..6933fe7 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -19,19 +19,19 @@ jobs: python-version: [3.9, 3.11, 3.12] steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install flake8 pylint pytest pytest-cov - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 and pylint - run: | - make lint - - name: Test with pytest - run: | - make test + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pylint pytest pytest-cov + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 and pylint + run: | + make lint + - name: Test with pytest + run: | + make test From 91d5674bf2e4beae05d9b81030890a6fd99f5f78 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:42:57 -0700 Subject: [PATCH 29/53] add header --- .github/workflows/release-drafter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 5b27fd6..6accb46 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -1,3 +1,4 @@ +--- name: Release Drafter on: From 15f0234988203862425dfdaf131def6640a5550a Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:50:08 -0700 Subject: [PATCH 30/53] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f0ac1d1..2246c39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY requirements.txt *.py /action/workspace/ RUN python3 -m pip install --no-cache-dir -r requirements.txt \ && apt-get -y update \ - && apt-get -y install --no-install-recommends git=v2.42.0 \ + && apt-get -y install --no-install-recommends git=1:2.25.1-1ubuntu3.11 \ && rm -rf /var/lib/apt/lists/* CMD ["/action/workspace/contributors.py"] From 624c5ccb90aac22414dd878a3861d617af5c6ecc Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:51:39 -0700 Subject: [PATCH 31/53] Update major-version-updater.yml --- .github/workflows/major-version-updater.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index 5ca5f95..3d0dfdf 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -18,7 +18,7 @@ jobs: tag=${GITHUB_REF/refs\/tags\//} version=${tag#v} major=${version%%.*} - {echo "tag=${tag}"; echo "version=${version}"; echo "major=${major}"} >> "$GITHUB_OUTPUT" + { echo "tag=${tag}"; echo "version=${version}"; echo "major=${major}" } >> "$GITHUB_OUTPUT" - name: force update major tag run: | From cb460705c3c2bba87c0e17e8f9a7a5a55908f171 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:53:01 -0700 Subject: [PATCH 32/53] fix git version install --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2246c39..d6a8699 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY requirements.txt *.py /action/workspace/ RUN python3 -m pip install --no-cache-dir -r requirements.txt \ && apt-get -y update \ - && apt-get -y install --no-install-recommends git=1:2.25.1-1ubuntu3.11 \ + && apt-get -y install --no-install-recommends git-svn=1:2.25.1-1ubuntu3.11 \ && rm -rf /var/lib/apt/lists/* CMD ["/action/workspace/contributors.py"] From 6507dbc806570091d8ea725cb3a5a68da30ac91b Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 14:56:01 -0700 Subject: [PATCH 33/53] Add typing import Signed-off-by: Zack Koppert --- contributor_stats.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contributor_stats.py b/contributor_stats.py index 04bf587..2e75e86 100644 --- a/contributor_stats.py +++ b/contributor_stats.py @@ -12,6 +12,7 @@ # ] +from typing import List import requests @@ -99,7 +100,7 @@ def merge_contributors(contributors: list) -> list: Returns: merged_contributors (list): A list of ContributorStats objects with no duplicate usernames """ - merged_contributors:List[ContributorStats] = [] + merged_contributors: List[ContributorStats] = [] for contributor_list in contributors: for contributor in contributor_list: # if the contributor is already in the merged list, merge their relavent attributes From 6c4415d9af8d7a7245f185c7a17324cab48efbcd Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:00:47 -0700 Subject: [PATCH 34/53] import typing Signed-off-by: Zack Koppert --- env.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/env.py b/env.py index 6b68554..faca75a 100644 --- a/env.py +++ b/env.py @@ -2,11 +2,14 @@ import os from os.path import dirname, join +from typing import Any from dotenv import load_dotenv -def get_env_vars() -> tuple[str | None, list[str], str, str, str | None, str | None, str | Any]: +def get_env_vars() -> ( + tuple[str | None, list[str], str, str, str | None, str | None, str | Any] +): """ Get the environment variables for use in the action. From 988fde4fb275fe50d18f93eb507e56b99b7e7e3f Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:05:13 -0700 Subject: [PATCH 35/53] update git version Signed-off-by: Zack Koppert --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d6a8699..6c225fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY requirements.txt *.py /action/workspace/ RUN python3 -m pip install --no-cache-dir -r requirements.txt \ && apt-get -y update \ - && apt-get -y install --no-install-recommends git-svn=1:2.25.1-1ubuntu3.11 \ + && apt-get -y install --no-install-recommends git=1:2.25.1-1 \ && rm -rf /var/lib/apt/lists/* CMD ["/action/workspace/contributors.py"] From e8f39ffd350e2e0a035ce7b3f99efbcafea3f0fb Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:07:00 -0700 Subject: [PATCH 36/53] drop python v3.9 support --- .github/workflows/python-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 6933fe7..0555c39 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9, 3.11, 3.12] + python-version: [3.11, 3.12] steps: - uses: actions/checkout@v4 From a40c7dbac64fefe82be349e02636a34e1fcdc579 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:24:06 -0700 Subject: [PATCH 37/53] fix version of git Signed-off-by: Zack Koppert --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6c225fc..fab3fa8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY requirements.txt *.py /action/workspace/ RUN python3 -m pip install --no-cache-dir -r requirements.txt \ && apt-get -y update \ - && apt-get -y install --no-install-recommends git=1:2.25.1-1 \ + && apt-get -y install --no-install-recommends git-all=1:2.39.2-1.1 \ && rm -rf /var/lib/apt/lists/* CMD ["/action/workspace/contributors.py"] From b5ddb2f12d437b220b93fb8756767f517b32b7db Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:25:16 -0700 Subject: [PATCH 38/53] only check on PRs Signed-off-by: Zack Koppert --- .github/workflows/super-linter.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/super-linter.yaml b/.github/workflows/super-linter.yaml index f329979..52a8839 100644 --- a/.github/workflows/super-linter.yaml +++ b/.github/workflows/super-linter.yaml @@ -10,9 +10,6 @@ name: Lint Code Base # Start the job on all push # ############################# on: - push: - branches-ignore: main - # Remove the line above to run when pushing to master or main pull_request: branches: main From b805bf0f95cf949c56076341989974ad887ed2ff Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:26:01 -0700 Subject: [PATCH 39/53] sort imports Signed-off-by: Zack Koppert --- contributor_stats.py | 1 + 1 file changed, 1 insertion(+) diff --git a/contributor_stats.py b/contributor_stats.py index 2e75e86..1d7b1db 100644 --- a/contributor_stats.py +++ b/contributor_stats.py @@ -13,6 +13,7 @@ from typing import List + import requests From b5f662d6fe2e8cee015de9aa11ca37f68158e74b Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:27:36 -0700 Subject: [PATCH 40/53] add spacing Signed-off-by: Zack Koppert --- .github/pull_request_template.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 62c7d95..beb28c0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -7,9 +7,11 @@ ## Readiness Checklist ### Author/Contributor + - [ ] If documentation is needed for this change, has that been included in this pull request - [ ] run `make lint` and fix any issues that you have introduced - [ ] run `make test` and ensure you have test coverage for the lines you are introducing ### Reviewer + - [ ] Label as either `bug`, `documentation`, `enhancement`, `infrastructure`, or `breaking` From 247f9cf5cb2a4c1cb4116fa50a8f703ee6e30469 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:28:34 -0700 Subject: [PATCH 41/53] add spacing Signed-off-by: Zack Koppert --- CONTRIBUTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d6842b4..8cb8fdf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,8 +29,9 @@ We will then take care of the issue as soon as possible. ## I Want To Contribute -> ### Legal Notice -> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. +### Legal Notice + +When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. ## Reporting Bugs @@ -92,6 +93,7 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/github To release a new version, maintainers are to release new versions following semantic versioning and via GitHub Releases. Once the code is ready to release please do the following + 1. Create a [GitHub release](https://github.com/github/contributors/releases) based off the current draft and review release notes 2. Ensure that the versioning is correct given the content of the release 3. Check the box to release it to the GitHub Marketplace From a9de2cac47329b2c7d5320f7e654b9cc14a12e0e Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:29:33 -0700 Subject: [PATCH 42/53] fix typo Signed-off-by: Zack Koppert --- .github/linters/.markdown-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml index 2cd983b..c796544 100644 --- a/.github/linters/.markdown-lint.yml +++ b/.github/linters/.markdown-lint.yml @@ -23,4 +23,4 @@ MD013: false # singe h1 MD025: false # duplicate headers -MDO24: false +MD024: false From 1ada85871d4e0b0bd01f13cb495f2681d8580a48 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:30:38 -0700 Subject: [PATCH 43/53] set threshold for duplication Signed-off-by: Zack Koppert --- .github/linters/.jscpd.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/linters/.jscpd.json b/.github/linters/.jscpd.json index 0c773a5..225b930 100644 --- a/.github/linters/.jscpd.json +++ b/.github/linters/.jscpd.json @@ -1,5 +1,7 @@ { - "threshold": 0.1, - "ignore": ["test*"], + "threshold": 25, + "ignore": [ + "test*" + ], "absolute": true -} +} \ No newline at end of file From a9f5a9341a1ee997dd85574befdc49b972f622b8 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:33:58 -0700 Subject: [PATCH 44/53] revert to multiple statements Signed-off-by: Zack Koppert --- .github/workflows/major-version-updater.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index 3d0dfdf..d4638a5 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -18,7 +18,9 @@ jobs: tag=${GITHUB_REF/refs\/tags\//} version=${tag#v} major=${version%%.*} - { echo "tag=${tag}"; echo "version=${version}"; echo "major=${major}" } >> "$GITHUB_OUTPUT" + echo "tag=${tag}" >> "$GITHUB_OUTPUT" + echo "version=${version}" >> "$GITHUB_OUTPUT" + echo "major=${major}" } >> "$GITHUB_OUTPUT" - name: force update major tag run: | From 8c53366b46450093312060fbf6540b7df61641ae Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:41:19 -0700 Subject: [PATCH 45/53] disable multi command suggests Signed-off-by: Zack Koppert --- .github/linters/.shellcheckrc | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/linters/.shellcheckrc diff --git a/.github/linters/.shellcheckrc b/.github/linters/.shellcheckrc new file mode 100644 index 0000000..8d3c10c --- /dev/null +++ b/.github/linters/.shellcheckrc @@ -0,0 +1,2 @@ +# Don't suggest [ -n "$VAR" ] over [ ! -z "$VAR" ] +disable=SC2129 From bf359f6cf671e3e4a9f6eefdbc9dee4272617582 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:47:42 -0700 Subject: [PATCH 46/53] sort imports Signed-off-by: Zack Koppert --- .github/workflows/major-version-updater.yml | 12 ++++++------ test_contributors.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index d4638a5..c88eebe 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -15,12 +15,12 @@ jobs: - name: version id: version run: | - tag=${GITHUB_REF/refs\/tags\//} - version=${tag#v} - major=${version%%.*} - echo "tag=${tag}" >> "$GITHUB_OUTPUT" - echo "version=${version}" >> "$GITHUB_OUTPUT" - echo "major=${major}" } >> "$GITHUB_OUTPUT" + tag=${ GITHUB_REF/refs\/tags\// } ; \ + version=${tag#v} ; \ + major=${version%%.*} ; \ + echo "tag=${tag}" >> "$GITHUB_OUTPUT" ; \ + echo "version=${version}" >> "$GITHUB_OUTPUT" ; \ + echo "major=${major}" } >> "$GITHUB_OUTPUT" ; \ - name: force update major tag run: | diff --git a/test_contributors.py b/test_contributors.py index 68f8475..ab75d0c 100644 --- a/test_contributors.py +++ b/test_contributors.py @@ -1,10 +1,10 @@ """This module contains the tests for the contributors.py module""" import unittest -from unittest.mock import patch, MagicMock -from contributor_stats import ContributorStats +from unittest.mock import MagicMock, patch -from contributors import get_contributors, get_all_contributors +from contributor_stats import ContributorStats +from contributors import get_all_contributors, get_contributors class TestContributors(unittest.TestCase): From ebd05520e312ddb232e2ea4c2c2e22b528d0dd47 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 15:49:04 -0700 Subject: [PATCH 47/53] ignore import name mismatch Signed-off-by: Zack Koppert --- .github/linters/.mypy.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/linters/.mypy.ini b/.github/linters/.mypy.ini index e314a85..18c5ef9 100644 --- a/.github/linters/.mypy.ini +++ b/.github/linters/.mypy.ini @@ -1,4 +1,4 @@ # Global options: [mypy] -disable_error_code = attr-defined +disable_error_code = attr-defined, import-not-found From 9f0320281145e6eca4c1b3eba2f80136673eec38 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 16:48:40 -0700 Subject: [PATCH 48/53] use bash --- .github/workflows/major-version-updater.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index c88eebe..a5a0f6c 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -14,8 +14,9 @@ jobs: - name: version id: version + shell: bash run: | - tag=${ GITHUB_REF/refs\/tags\// } ; \ + tag=${ GITHUB_REF/refs\/tags\// } ; \ version=${tag#v} ; \ major=${version%%.*} ; \ echo "tag=${tag}" >> "$GITHUB_OUTPUT" ; \ From b313ad063d921992224fa111964c24afa22bf3fd Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 17:38:14 -0700 Subject: [PATCH 49/53] update shell code for tag updates Signed-off-by: Zack Koppert --- .github/workflows/major-version-updater.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index a5a0f6c..a4a8315 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -16,12 +16,13 @@ jobs: id: version shell: bash run: | - tag=${ GITHUB_REF/refs\/tags\// } ; \ + # shellcheck disable=all + tag=${GITHUB_REF/refs\/tags\//}; \ version=${tag#v} ; \ major=${version%%.*} ; \ echo "tag=${tag}" >> "$GITHUB_OUTPUT" ; \ echo "version=${version}" >> "$GITHUB_OUTPUT" ; \ - echo "major=${major}" } >> "$GITHUB_OUTPUT" ; \ + echo "major=${major}" >> "$GITHUB_OUTPUT" ; - name: force update major tag run: | From d485c6ff12debc625a8242cff921c25998f29458 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 19:06:16 -0700 Subject: [PATCH 50/53] try same line Signed-off-by: Zack Koppert --- .github/workflows/major-version-updater.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index a4a8315..4638b95 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -16,7 +16,7 @@ jobs: id: version shell: bash run: | - # shellcheck disable=all + # shellcheck disable=all \ tag=${GITHUB_REF/refs\/tags\//}; \ version=${tag#v} ; \ major=${version%%.*} ; \ From 68f4c6f39c873cd020f3e52536d0d57d4068fe3a Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 19:12:45 -0700 Subject: [PATCH 51/53] revert line continuation Signed-off-by: Zack Koppert --- .github/workflows/major-version-updater.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index 4638b95..a4a8315 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -16,7 +16,7 @@ jobs: id: version shell: bash run: | - # shellcheck disable=all \ + # shellcheck disable=all tag=${GITHUB_REF/refs\/tags\//}; \ version=${tag#v} ; \ major=${version%%.*} ; \ From fa427f545739f12e3ab1aac80f4ef0fb5e87fdff Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 19:24:05 -0700 Subject: [PATCH 52/53] individual lines Signed-off-by: Zack Koppert --- .github/workflows/major-version-updater.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index a4a8315..f8c36a4 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -17,11 +17,11 @@ jobs: shell: bash run: | # shellcheck disable=all - tag=${GITHUB_REF/refs\/tags\//}; \ - version=${tag#v} ; \ - major=${version%%.*} ; \ - echo "tag=${tag}" >> "$GITHUB_OUTPUT" ; \ - echo "version=${version}" >> "$GITHUB_OUTPUT" ; \ + tag=${GITHUB_REF/refs\/tags\//}; + version=${tag#v} ; + major=${version%%.*} ; + echo "tag=${tag}" >> "$GITHUB_OUTPUT" ; + echo "version=${version}" >> "$GITHUB_OUTPUT" ; echo "major=${major}" >> "$GITHUB_OUTPUT" ; - name: force update major tag From 502e761ba51af1e197d13e3a53a97572fa8e41a2 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 2 Nov 2023 19:31:11 -0700 Subject: [PATCH 53/53] no double actionlint Signed-off-by: Zack Koppert --- .github/workflows/super-linter.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/super-linter.yaml b/.github/workflows/super-linter.yaml index 52a8839..e49ed86 100644 --- a/.github/workflows/super-linter.yaml +++ b/.github/workflows/super-linter.yaml @@ -53,3 +53,4 @@ jobs: env: DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_ACTIONS_COMMAND_ARGS: -shellcheck=