diff --git a/.github/workflows/manage_issues.yml b/.github/workflows/manage_issues.yml index c4cf812..4c07edc 100644 --- a/.github/workflows/manage_issues.yml +++ b/.github/workflows/manage_issues.yml @@ -1,8 +1,9 @@ name: Manage issues and pull requests in projects on: - workflow_dispatch: schedule: - cron: "45 * * * *" # Hourly at 45 minutes past the hour (**:45) + workflow_dispatch: + jobs: manage_issues_and_pull_requests: @@ -26,17 +27,14 @@ jobs: uses: actions/checkout@v4 - name: Install Python dependencies - run: | - pipenv sync --dev --system + run: pipenv sync --system - name: 'run script to move closed issues to Active Sprint: Done' - run: | - ./move_closed_issues.py + run: ./move_closed_issues.py env: ADMIN_GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} - - name: run script to track open issues and pull requests - run: | - ./track_issues_and_pull_requests.py + - name: run script to track open untriaged issues and pull requests + run: ./track_issues_and_pull_requests.py env: ADMIN_GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} diff --git a/.github/workflows/normalize_repos.yml b/.github/workflows/normalize_repos.yml index fba088f..5febede 100644 --- a/.github/workflows/normalize_repos.yml +++ b/.github/workflows/normalize_repos.yml @@ -1,40 +1,47 @@ name: Normalize Repos on: - workflow_dispatch: schedule: - cron: '0 0 * * *' # Daily at midnight (00:00) - push: - branches: - - main + workflow_dispatch: + jobs: normalize_repos: runs-on: ubuntu-latest steps: + + # https://github.com/actions/setup-python - name: Setup Python 3.11 uses: actions/setup-python@v5 with: python-version: '3.11' + - name: Install system dependencies run: | python -m pip install --upgrade pip python -m pip install pipenv + + # https://github.com/actions/checkout - uses: actions/checkout@v4 with: token: ${{ secrets.ADMIN_GITHUB_TOKEN }} + - name: Install app dependencies - run: | - pipenv sync + run: pipenv sync --system + - name: Run script with token in env - run: | - pipenv run ./normalize_repos.py + run: ./normalize_repos.py env: ADMIN_GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} + + # https://github.com/actions/upload-artifact - name: Export a report of invalid issues uses: actions/upload-artifact@v4 with: name: invalid-issue-report path: /tmp/invalid_issues.yml - - uses: gautamkrishnar/keepalive-workflow@v1 + + # https://github.com/gautamkrishnar/keepalive-workflow + - uses: gautamkrishnar/keepalive-workflow@v2 with: committer_username: cc-open-source-bot committer_email: opensource@creativecommons.org diff --git a/.github/workflows/push_data_to_ccos.yml b/.github/workflows/push_data_to_ccos.yml index 6504ffb..f40bd2f 100644 --- a/.github/workflows/push_data_to_ccos.yml +++ b/.github/workflows/push_data_to_ccos.yml @@ -2,28 +2,33 @@ name: Push data to CC Open Source on: schedule: - cron: '15 0 * * *' # Daily at midnight:15 (00:15) - push: - branches: - - main + workflow_dispatch: + jobs: push_data: runs-on: ubuntu-latest steps: + + # https://github.com/actions/setup-python - name: Setup Python 3.11 uses: actions/setup-python@v5 with: python-version: '3.11' + - name: Install system dependencies run: | python -m pip install --upgrade pip python -m pip install pipenv - - uses: actions/checkout@v4 + + # https://github.com/actions/checkout + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install app dependencies - run: | - pipenv sync + run: pipenv sync --system + - name: Run script with tokens in env - run: | - pipenv run ./push_data_to_ccos.py + run: ./push_data_to_ccos.py env: ADMIN_GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} ADMIN_ASANA_TOKEN: ${{ secrets.ADMIN_ASANA_TOKEN }} diff --git a/.github/workflows/sync_community_teams.yml b/.github/workflows/sync_community_teams.yml index e9c172d..0b96aa2 100644 --- a/.github/workflows/sync_community_teams.yml +++ b/.github/workflows/sync_community_teams.yml @@ -2,28 +2,33 @@ name: Sync Community Teams with GitHub on: schedule: - cron: '30 0 * * *' # Daily at midnight:30 (00:30) - push: - branches: - - main + workflow_dispatch: + jobs: sync_community_teams: runs-on: ubuntu-latest steps: + + # https://github.com/actions/setup-python - name: Setup Python 3.11 uses: actions/setup-python@v5 with: python-version: '3.11' + - name: Install system dependencies run: | python -m pip install --upgrade pip python -m pip install pipenv - - uses: actions/checkout@v4 + + # https://github.com/actions/checkout + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install app dependencies - run: | - pipenv sync + run: pipenv sync --system + - name: Run script with tokens in env - run: | - pipenv run ./sync_community_teams.py + run: ./sync_community_teams.py env: ADMIN_GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }} ADMIN_ASANA_TOKEN: ${{ secrets.ADMIN_ASANA_TOKEN }} diff --git a/Pipfile b/Pipfile index f113931..644dea7 100644 --- a/Pipfile +++ b/Pipfile @@ -4,19 +4,20 @@ url = "https://pypi.org/simple" verify_ssl = true [dev-packages] -black = "*" +black = ">=24.3.0" flake8 = "*" isort = "*" -tomli = "*" [packages] asana = ">=3.2,<4" # "Please use v3.2.X for stable / production environments" cryptography = ">=42.0.4" # dependency, pinned for security emoji = "*" GitPython = ">=3.1.41" +idna = ">=3.7" # dependency, pinned for security PyGithub = "*" PyYAML = "*" requests = "*" +urllib3 = ">=2.0.6" # dependency, pinned for security [requires] python_version = "3.11" diff --git a/Pipfile.lock b/Pipfile.lock index 108b8e9..748f912 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "2a5f13a1e2edddff970cf68010a5e1a2b47d22047f959d61ccc0d3a0ce1b85f8" + "sha256": "257af3904c345be72382f66ce5fe28c6963e90a970e4d125cd826378910dc1f3" }, "pipfile-spec": 6, "requires": { @@ -235,12 +235,12 @@ }, "emoji": { "hashes": [ - "sha256:11fb369ea79d20c14efa4362c732d67126df294a7959a2c98bfd7447c12a218e", - "sha256:16287283518fb7141bde00198f9ffff4e1c1cb570efb68b2f1ec50975c3a581d" + "sha256:63fc9107f06c6c2e48e5078ce9575cef98518f5ac09474f6148a43e989989582", + "sha256:772eaa30f4e0b1ce95148a092df4c7dc97644532c03225326b0fd05e8a9f72a3" ], "index": "pypi", "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.10.1" + "version": "==2.11.0" }, "gitdb": { "hashes": [ @@ -252,20 +252,20 @@ }, "gitpython": { "hashes": [ - "sha256:1bf9cd7c9e7255f77778ea54359e54ac22a72a5b51288c457c881057b7bb9ecd", - "sha256:2d99869e0fef71a73cbd242528105af1d6c1b108c60dfabd994bf292f76c3ceb" + "sha256:35f314a9f878467f5453cc1fee295c3e18e52f1b99f10f6cf5b1682e968a9e7c", + "sha256:eec7ec56b92aad751f9912a73404bc02ba212a23adb2c7098ee668417051a1ff" ], "index": "pypi", "markers": "python_version >= '3.7'", - "version": "==3.1.42" + "version": "==3.1.43" }, "idna": { "hashes": [ - "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca", - "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f" + "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc", + "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0" ], "markers": "python_version >= '3.5'", - "version": "==3.6" + "version": "==3.7" }, "oauthlib": { "hashes": [ @@ -277,20 +277,20 @@ }, "pycparser": { "hashes": [ - "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9", - "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206" + "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6", + "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.21" + "markers": "python_version >= '3.8'", + "version": "==2.22" }, "pygithub": { "hashes": [ - "sha256:41042ea53e4c372219db708c38d2ca1fd4fadab75475bac27d89d339596cfad1", - "sha256:e39be7c4dc39418bdd6e3ecab5931c636170b8b21b4d26f9ecf7e6102a3b51c3" + "sha256:0148d7347a1cdeed99af905077010aef81a4dad988b0ba51d4108bf66b443f7e", + "sha256:65b499728be3ce7b0cd2cd760da3b32f0f4d7bc55e5e0677617f90f6564e793e" ], "index": "pypi", "markers": "python_version >= '3.7'", - "version": "==2.2.0" + "version": "==2.3.0" }, "pyjwt": { "extras": [ @@ -404,17 +404,18 @@ }, "typing-extensions": { "hashes": [ - "sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475", - "sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb" + "sha256:83f085bd5ca59c80295fc2a82ab5dac679cbe02b9f33f7d83af68e241bea51b0", + "sha256:c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a" ], "markers": "python_version >= '3.8'", - "version": "==4.10.0" + "version": "==4.11.0" }, "urllib3": { "hashes": [ "sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d", "sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19" ], + "index": "pypi", "markers": "python_version >= '3.8'", "version": "==2.2.1" }, @@ -606,15 +607,6 @@ ], "markers": "python_version >= '3.8'", "version": "==3.2.0" - }, - "tomli": { - "hashes": [ - "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", - "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" - ], - "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==2.0.1" } } } diff --git a/dev/test.sh b/dev/test.sh index 660102f..0b0b389 100755 --- a/dev/test.sh +++ b/dev/test.sh @@ -13,7 +13,7 @@ set -o nounset # https://en.wikipedia.org/wiki/ANSI_escape_code E0="$(printf "\e[0m")" # reset E30="$(printf "\033[30m")" # black foreground -E31="$(printf "\e[31m")" # red foreground +E31="$(printf "\e[31m")" # red foreground E107="$(printf "\033[107m")" # bright white background